<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.tjtt.tdm.system.action.ShowTree" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管道检测评价系统</title>
<link href="css/index1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javaScript">
	var webroot="<%=request.getContextPath() %>";
</script>
<script type="text/javascript" src="<%=request.getContextPath() %>/fileupload/scripts/json.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/ztree/js/jquery-1.4.4.min.js"></script>
<link href="<%=request.getContextPath() %>/web/style/layout.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="<%=request.getContextPath() %>/jslib/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/ztree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/ztree/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/frame/js/zuobiaodw.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/frame/js/didianss.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/frame/js/shijiandw.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/frame/js/search.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/frame/js/map.js"></script>
<style type='text/css'>
ul.ztree {margin-top: -10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:480px;overflow-y:scroll;overflow-x:auto;}
.contRgt {margin-top: -10px;border: 1px solid #617775;background: #EAEAEA;width:220px;height:480px;overflow-y:scroll;overflow-x:auto;}
</style>

<script type="text/javascript">
//SuckerTree Vertical Menu (Aug 4th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/
var isChecked=false;  //是否勾选
var isToExpand=false; //是否需要展开
var isLoading=false;  //是否正在加载展开结构树，在地图上画
var g_type=""; //勾选的类型
var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas
var isNodeChecked={};  //记录节点是否为勾选状态 map
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)

//退出系统
function logout() {
    $.ajax({
        dataType: 'text',
        type: "POST",
        url: "<%=request.getContextPath() %>/userLoginOut.action",
        error: function (XMLHttpRequest, textStatus) 
        { 
        	if (XMLHttpRequest.status == 500) 
        	{ alert(XMLHttpRequest.responseText); 
        	} 
        },
        success: function (data) {
            $.dialog({
            	title: '系统消息',
			    time: 2,
			    content: "已成功退出系统！"
			});
            setTimeout(function () {
                window.location.href=data;
            }, 1800);
        }
    });
}
</script>

<script type="text/javascript">
		var zTreeNodes = [ {
			"id" : "0",
			"pId" : "-1",
			"name" : "北京管网",
			isParent : true,
			"nodetype":"gwroot"
		} ];//数据 
		
		var demoMsg = {
			async:"正在进行异步加载，请等一会儿再点击...",
			expandAllOver: "全部展开完毕",
			asyncAllOver: "后台异步加载完毕",
			asyncAll: "已经异步加载完毕，不再重新加载",
			expandAll: "已经异步加载完毕，使用 expandAll 方法"
		}
		var setting = {
			check: {
		        enable: true
			    },
			data: {
			        simpleData: {
			            enable: true
			        }
			    },
			async: {
				enable: true,
				url:"<%=request.getContextPath() %>/guanxianAction!getGuanxianTree.action",
				autoParam:["id"],
				otherParam:{"nodetypes":""},
				dataFilter: filter,
				dataType : "text",
				type: "get"
			},
			callback: {
				onClick: zTreeOnClick,
				onDblClick: zTreeOnDblClick,
				beforeAsync: beforeAsync,
				onAsyncSuccess: onAsyncSuccess,
				onAsyncError: onAsyncError,
				onCheck: zTreeOnCheck,
				onExpand: zTreeOnExpand
			},
			view: {
				fontCss: getFontCss
			}
		};
		function zTreeOnExpand(event, treeId, treeNode) {
			//更新节点名称
			if(treeNode.isParent==true)
			{
				var id=treeNode.id;
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				var nodes = treeObj.getNodesByParam("pId", id, null);
				var num=nodes.length;
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				if(treeNode.name.indexOf("-")==-1&&treeNode.id.indexOf("gx")==-1)
				{
					treeNode.name=treeNode.name+"-"+num;
					treeObj.updateNode(treeNode);
					//更新子节点勾选状态
					if(treeNode.checked==true)
					{					
						var nodes = treeObj.getNodesByParam("pId", treeNode.id, null);					
						for(var i=0;i<nodes.length;i++)
						{						
							zTree.checkNode(nodes[i],true,true);
						}
					}	
				}				
			}
			
    		/*var num=treeNode.children.length;
			var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
			if(treeNode.name.indexOf("-")==-1&&treeNode.id.indexOf("gx")==-1)
			{
				treeNode.name=treeNode.name+"-"+num;
				treeObj.updateNode(treeNode);
				//更新子节点勾选状态
				if(treeNode.checked==true)
				{					
					var nodes = treeObj.getNodesByParam("pId", treeNode.id, null);					
					for(var i=0;i<nodes.length;i++)
					{						
						zTree.checkNode(nodes[i],true,true);
					}
				}		
			}*/	
		};
		
		function focusKey(e) {
			if (key.hasClass("empty")) {
				key.removeClass("empty");
			}
		}
		function blurKey(e) {
			if (key.get(0).value === "") {
				key.addClass("empty");
			}
		}
		
		function zTreeOnClick(event, treeId, treeNode) {
		    var id=treeNode.id;		    
		    //document.getElementById("mapcontent").contentWindow.showAddress(id);
		     //显示管段列表
			if (id.indexOf('gdroot')==0){			
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4861+"&pipelineno="+id.replace("gdroot","");
				$("#tableframe").slideDown();
			}
		    //显示阀门列表
			if (id.indexOf('valveRoot')==0){			
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4830+"&pipelineno="+id.replace("valveRoot","");
				$("#tableframe").slideDown();
			}
		    //显示特征点列表
		    if (id.indexOf('tz')==0){				
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/tezhenglist.jsp?tzid="+id.replace("tz","");
				$("#tableframe").slideDown();
			}
			//显示三通列表
			if (id.indexOf('pointTee')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointTeeList.jsp?tzid="+id.replace("pointTee","");
				$("#tableframe").slideDown();
			}
			//显示套管
			if (id.indexOf('taoguanRoot')==0){
			
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4827+"&pipelineno="+id.replace("taoguanRoot","");
				$("#tableframe").slideDown();
			}
			//显示弯管
			if (id.indexOf('wanguanRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4828+"&pipelineno="+id.replace("wanguanRoot","");
				$("#tableframe").slideDown();
			}
			//穿跨越
			if (id.indexOf('chuankuayRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4826+"&pipelineno="+id.replace("chuankuayRoot","");
				$("#tableframe").slideDown();
			}
			//内衬
			if (id.indexOf('neichenRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4829+"&pipelineno="+id.replace("neichenRoot","");
				$("#tableframe").slideDown();
			}
			//显示测试桩列表
			if (id.indexOf('pointPole')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointPoleList.jsp?tzid="+id.replace("pointPole","");
				$("#tableframe").slideDown();
			}
			//显示违章占压列表
			if (id.indexOf('wzzy')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/weizhangzhanyaList.jsp?tzid="+id.replace("wzzy","");
				$("#tableframe").slideDown();
			}
			//显示导波检测列表
			if (id.indexOf('dbjc')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/daobojianceList.jsp?tzid="+id.replace("dbjc","");
				$("#tableframe").slideDown();
			}
			//显示阳极列表
			if (id.indexOf('pointAnodeRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="+4823+"&pipelineno="+id.replace("pointAnodeRoot","");
				$("#tableframe").slideDown();
			}
			//排流装置
			if (id.indexOf('pointDrainageRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4825+"&pipelineno="+id.replace("pointDrainageRoot","");
				$("#tableframe").slideDown();
			}
			//异常
			if (id.indexOf('yichangRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4841+"&pipelineno="+id.replace("yichangRoot","");
				$("#tableframe").slideDown();
			}
			//特殊段
			if (id.indexOf('teshuduanRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5145+"&pipelineno="+id.replace("teshuduanRoot","");
				$("#tableframe").slideDown();
			}
			//生产作业点
			if (id.indexOf('shengchanzydRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5581+"&pipelineno="+id.replace("shengchanzydRoot","");
				$("#tableframe").slideDown();
			}
			//带气作业机械预制件
			if (id.indexOf('dqzyjxyzhRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4847+"&pipelineno="+id.replace("dqzyjxyzhRoot","");
				$("#tableframe").slideDown();
			}
			//事件点
			if (id.indexOf('sjdRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5601+"&pipelineno="+id.replace("sjdRoot","");
				$("#tableframe").slideDown();
			}			
			//泄漏点
			if (id.indexOf('xldRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4845+"&pipelineno="+id.replace("xldRoot","");
				$("#tableframe").slideDown();
			}
			//特征点检查
			if (id.indexOf('testtzhdjchRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4901+"&pipelineno="+id.replace("testtzhdjchRoot","");
				$("#tableframe").slideDown();
			}
			//穿越检查
			if (id.indexOf('chyjchRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4902+"&pipelineno="+id.replace("chyjchRoot","");
				$("#tableframe").slideDown();
			}
			//外观检查
			if (id.indexOf('wgjchRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4911+"&pipelineno="+id.replace("wgjchRoot","");
				$("#tableframe").slideDown();
			}
			//壁厚检测
			if (id.indexOf('bhjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4987+"&pipelineno="+id.replace("bhjcRoot","");
				$("#tableframe").slideDown();
			}
			//防腐层厚度检测
			if (id.indexOf('ffchdjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4989+"&pipelineno="+id.replace("ffchdjcRoot","");
				$("#tableframe").slideDown();
			}
			//防腐层破损检测
			if (id.indexOf('ffcpsjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4913+"&pipelineno="+id.replace("ffcpsjcRoot","");
				$("#tableframe").slideDown();
			}
			//腐蚀状况检测
			if (id.indexOf('fshzhkjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4914+"&pipelineno="+id.replace("fshzhkjcRoot","");
				$("#tableframe").slideDown();
			}
			//射线检测
			if (id.indexOf('shexianjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4991+"&pipelineno="+id.replace("shexianjcRoot","");
				$("#tableframe").slideDown();
			}
			//磁记忆检测
			if (id.indexOf('cjyjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4916+"&pipelineno="+id.replace("cjyjcRoot","");
				$("#tableframe").slideDown();
			}
			//瞬变电磁检测
			if (id.indexOf('shbdcjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4917+"&pipelineno="+id.replace("shbdcjcRoot","");
				$("#tableframe").slideDown();
			}
			//应力试验
			if (id.indexOf('ylshyRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4999+"&pipelineno="+id.replace("ylshyRoot","");
				$("#tableframe").slideDown();
			}
			//化学成分分析
			if (id.indexOf('hxchffxRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4993+"&pipelineno="+id.replace("hxchffxRoot","");
				$("#tableframe").slideDown();
			}
			//硬度测试
			if (id.indexOf('ydcshRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5001+"&pipelineno="+id.replace("ydcshRoot","");
				$("#tableframe").slideDown();
			}
			//金相分析
			if (id.indexOf('jxfxRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5003+"&pipelineno="+id.replace("jxfxRoot","");
				$("#tableframe").slideDown();
			}
			//拉伸试验
			if (id.indexOf('lshshyRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4995+"&pipelineno="+id.replace("lshshyRoot","");
				$("#tableframe").slideDown();
			}
			//弯曲试验
			if (id.indexOf('wqshiyRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5004+"&pipelineno="+id.replace("wqshiyRoot","");
				$("#tableframe").slideDown();
			}
			//冲击试验
			if (id.indexOf('chjshyRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4997+"&pipelineno="+id.replace("chjshyRoot","");
				$("#tableframe").slideDown();
			}
			//检测点
			if (id.indexOf('xljcjcdRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4903+"&pipelineno="+id.replace("xljcjcdRoot","");
				$("#tableframe").slideDown();
			}
			//泄漏点
			if (id.indexOf('xljcxldRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4903+"&pipelineno="+id.replace("xljcxldRoot","")+"&type=xljcxld";
				$("#tableframe").slideDown();
			}
			//土壤腐蚀性检测
			if (id.indexOf('trfshxjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4904+"&pipelineno="+id.replace("trfshxjcRoot","");
				$("#tableframe").slideDown();
			}
			//杂散电流检测
			if (id.indexOf('zsdljcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+5261+"&pipelineno="+id.replace("zsdljcRoot","");
				$("#tableframe").slideDown();
			}
			//防腐层检测点
			if (id.indexOf('ffcjcdRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4941+"&pipelineno="+id.replace("ffcjcdRoot","");
				$("#tableframe").slideDown();
			}
			//防腐层破损点
			if (id.indexOf('ffcpsdRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4905+"&pipelineno="+id.replace("ffcpsdRoot","");
				$("#tableframe").slideDown();
			}
			//测试桩检测
			if (id.indexOf('cshzhjcRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4907+"&pipelineno="+id.replace("cshzhjcRoot","");
				$("#tableframe").slideDown();
			}
			//阴极保护密间隔检测点
			if (id.indexOf('yjbhmjgjcdRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4986+"&pipelineno="+id.replace("yjbhmjgjcdRoot","");
				$("#tableframe").slideDown();
			}
			//过滤器
			if (id.indexOf('glqRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4835+"&pipenetno="+id.replace("glqRoot","");
				$("#tableframe").slideDown();
			}
			//安全阀
			if (id.indexOf('aqfRoot')==0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				+4836+"&pipenetno="+id.replace("aqfRoot","");
				$("#tableframe").slideDown();
			}
		}
		function zTreeOnDblClick(event, treeId, treeNode) {
	       
	    }
		
		function filter(treeId, parentNode, childNodes) {
			if (!childNodes) return null;
			for (var i=0, l=childNodes.length; i<l; i++) {
				childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
			}
			return childNodes;
		}

		function beforeAsync() {
			curAsyncCount++;
		}
		
		function onAsyncSuccess(event, treeId, treeNode, msg) {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo"); 	
			if(isToExpand==true)
			{
				//展开全部节点
				zTree.expandAll(true);	
				//关闭管段根节点				
		        var nodes = zTree.transformToArray(zTree.getNodes());		       
		        var ids=new Array();
		        var index=0;
				for(var i=0;i<nodes.length;i++)
				{
					var node=nodes[i];			
					var treeid = node.id;					
					if(treeid.indexOf("gdroot")>=0)
					{
						zTree.expandNode(node, false, true, true);	
					}	
					if(treeid.indexOf("valveRoot")>=0)
					{
						zTree.expandNode(node, false, true, true);	
					}	
					if(treeid.indexOf("zhanxiangroot")>=0)
					{
						zTree.expandNode(node, false, true, true);	
					}	
					//显示管线个数
					if(treeid.indexOf("guanxianroot")!=-1)
					{
						var num=node.children.length;
						if(node.name.indexOf("-")==-1&&node.id.indexOf("gx")==-1)
						{
							node.name=node.name+"-"+num;
							zTree.updateNode(node);
						}
					}						
					//关闭其他节点
					if(treeid.indexOf("guanxianroot")<0&&treeid.indexOf("gx")<0&&treeid!=0)
					{
						types=g_type.split(",");
						
						var length=types.length;
						var j=0;
						for(j=0;j<length;j++)
						{
							var type=types[j];
							if(type=="tezhengd")
							{
								type="tz";
							}
							if(treeid.indexOf(type)>=0)
							{
								break;
							}
						}
						if(j==length)
						{
							zTree.expandNode(node, false, true, true);	
						}
						else//勾选的类型的节点，显示子节点个数
						{	
							if(node.isParent==true)
							{
								zTree.expandNode(node, true, true, true);	
								var nodesTemp = zTree.getNodesByParam("pId", node.id, null);							
								var num=nodesTemp.length;
								if(node.name.indexOf("-")==-1&&node.id.indexOf("gx")==-1)
								{
									node.name=node.name+"-"+num;
									zTree.updateNode(node);
								}
								//alert(treeid);
								
								zTree.checkNode(node,true,true);
							}														
						}
					}							
				}
				//刷新结构树
				zTree.refresh();
				/*if(isChecked==true)
				{
					//勾选全部节点
					zTree.checkAllNodes(true);
				}*/	
				//设置勾选状态
				for(var i=0;i<nodes.length;i++)
				{
					var node=nodes[i];			
					var nodeid = node.id;
				    if(nodeid in isNodeChecked)	
				    {
				    	if(isNodeChecked[nodeid]==false)
				    	{
				    		zTree.checkNode(node,false,true);
				    	}
				    	else
				    	{
				    		zTree.checkNode(node,true,true);
				    	}
				    }	
				    else
				    {		
				   		zTree.checkNode(node,true,true);
				    }			
				}		
				zTree.refresh();
				isChecked=false;
				isToExpand=false;
				zTreeDrawAll();
			}		
			curAsyncCount--;
			if (curStatus == "expand") {
				expandNodes(treeNode.children);
			} else if (curStatus == "async") {
				asyncNodes(treeNode.children);
			}
			if (curAsyncCount <= 0) {
				if (curStatus != "init" && curStatus != "") {
					$("#demoMsg").text((curStatus == "expand") ? demoMsg.expandAllOver : demoMsg.asyncAllOver);
					asyncForAll = true;
				}
				curStatus = "";
				
			}	
		}				
		/*function onAsyncSuccess(event, treeId, treeNode, msg) {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo"); 		
			if(isToExpand==true)
			{
				//展开全部节点
				zTree.expandAll(true);
				
				zTree.refresh();
				if(isChecked==true)
				{
					//勾选全部节点
					zTree.checkAllNodes(true);
				}				
				zTree.refresh();
				isChecked=false;
				isToExpand=false;
				zTreeDrawAll();
			}		
			curAsyncCount--;
			if (curStatus == "expand") {
				expandNodes(treeNode.children);
			} else if (curStatus == "async") {
				asyncNodes(treeNode.children);
			}

			if (curAsyncCount <= 0) {
				if (curStatus != "init" && curStatus != "") {
					$("#demoMsg").text((curStatus == "expand") ? demoMsg.expandAllOver : demoMsg.asyncAllOver);
					asyncForAll = true;
				}
				curStatus = "";
			}
			isLoading=false;		
		}*/

		function onAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
			curAsyncCount--;

			if (curAsyncCount <= 0) {
				curStatus = "";
				if (treeNode!=null) asyncForAll = true;
			}
		}

		var curStatus = "init", curAsyncCount = 0, asyncForAll = false,
		goAsync = false;
		
		function asyncAll() {
			if (!check()) {
				return;
			}
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");
			if (asyncForAll) {
				$("#demoMsg").text(demoMsg.asyncAll);
			} else {
				asyncNodes(zTree.getNodes());
				if (!goAsync) {
					$("#demoMsg").text(demoMsg.asyncAll);
					curStatus = "";
				}
			}
		}
		function asyncNodes(nodes) {
			if (!nodes) return;
			curStatus = "async";
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");
			for (var i=0, l=nodes.length; i<l; i++) {
				if (nodes[i].isParent && nodes[i].zAsync) {
					asyncNodes(nodes[i].children);
				} else {
					goAsync = true;
					zTree.reAsyncChildNodes(nodes[i], "refresh", true);
				}
			}
		}
		
		function getFontCss(treeId, treeNode) {
			return (!!treeNode.highlight) ? {color:"#A60000", "font-weight":"bold"} : {color:"#333", "font-weight":"normal"};
		}

	  $(function () {
	    //var docHeight = $(document).height();
	    var docWidth = document.documentElement.clientWidth;
		var docHeight = document.documentElement.clientHeight;	
	    $(".contRgt").css("width", ((docWidth - $(".contLeft").width()-58) + "px"));
	    //$(".contLeft").css("height", docHeight);
		$(".content,.contLeft").css("height", ((docHeight - $(".head").height()-$(".navigation").height()-$(".foot").height()) + "px"));
		
	   })

    $(document).ready(function(){
		 $.fn.zTree.init($("#treeDemo"), setting,zTreeNodes);
			key = $("#key");
			key.bind("focus", focusKey)
			.bind("blur", blurKey)
			zTree = $.fn.zTree.getZTreeObj("treeDemo");
			var node = zTree.getNodeByParam('id','0',null);
			if (node != null) {
				zTree.expandNode(node, true, true, true);
			}
			
		//$("#cksantong").bind("change", function(){setPointCheck("#cksantong","pointTee")});  //三通		
		//$("#cktaoguan").bind("change", function(){setPointCheck("#cktaoguan","taoguan")});   //套管
		//$("#ckwanguan").bind("change", function(){setPointCheck("#ckwanguan","wanguan")});   //弯管
		//$("#ckyangji").bind("change", function(){setPointCheck("#ckyangji","pointAnode")});	//阳极
		//$("#ckceshiz").bind("change",  function(){setPointCheck("#ckceshiz","pointPole")});		//测试桩
		//$("#ckpailiuzz").bind("change", function(){setPointCheck("#ckpailiuzz","pointDrainage")});	//排流装置			
		//$("#ckyichang").bind("change", function(){setPointCheck("#ckyichang","yichang")});	//异常			
		//$("#ckteshuduan").bind("change", function(){setPointCheck("#ckteshuduan","teshuduan")});	//特殊段
		//$("#ckweizhangzhanya").bind("change",function(){setPointCheck("#ckweizhangzhanya","wzzy")});//违章占压
		//$("#ckshengchanzuoye").bind("change", setShengchanzuoyeCheck); 		//生产作业
		//$("#ckshengchanzuoyedian").bind("change", function(){setPointCheck("#ckshengchanzuoyedian","shchzyd")});//生产作业点
		//$("#ckdaiqizuoyejixieyuzhi").bind("change", function(){setPointCheck("#ckdaiqizuoyejixieyuzhi","dqzyjxyzh")}); //带气作业机械预制件
    	//$("#ckshijiandian").bind("change", function(){setPointCheck("#ckshijiandian","sjd")});//事件点
    	//$("#ckxieloudian").bind("change", function(){setPointCheck("#ckxieloudian","xld")}); //泄漏点
    	/*
    	$("#ckwaiguanjiancha").bind("change", function(){setPointCheck("#ckwaiguanjiancha","wgjch")});	//外观检查
    	$("#ckbihoujiance").bind("change", function(){setPointCheck("#ckbihoujiance","bhjc")});			//壁厚检测
    	$("#ckfangfucehoudujiance").bind("change", function(){setPointCheck("#ckfangfucehoudujiance","ffchdjc")});//防腐层厚度检测
    	$("#ckfangfucengposunjiance").bind("change", function(){setPointCheck("#ckfangfucengposunjiance","ffcpsjc")});//防腐层破损检测
    	$("#ckfushizhuangkuangjiance").bind("change", function(){setPointCheck("#ckfushizhuangkuangjiance","fshzhkjc")});//腐蚀状况检测
   		$("#ckshexianjiance").bind("change", function(){setPointCheck("#ckshexianjiance","shexianjc")});//射线检测   	
		*/
		//$("#ckcijiyijiance").bind("change", function(){setPointCheck("#ckcijiyijiance","cjyjc")});//磁记忆检测
    	//$("#ckshunbiandiancijiance").bind("change", function(){setPointCheck("#ckshunbiandiancijiance","shbdcjc")});//瞬变电磁检测
    	//$("#ckfangfucengjiancedian").bind("change", checkFangfucengjiancedian);
		//$("#ckfangfucengjiancedian").bind("change", function(){setPointCheck("#ckfangfucengjiancedian","ffcjcd")}); //防腐层检测点
		
		$("#ckweizhixinxi").bind("change", showweizhixinxi);      //管件
		$("#cktezhengd").bind("change", function(){setPointCheck("#cktezhengd","tezhengd")});   //特征点	
		$("#ckguanjian").bind("change", setGuanjianCheck);      //管件
		$("#cksantong").bind("change",setSantongCheck);   //三通	
		$("#cktaoguan").bind("change",setTaoguanCheck);   //套管
		$("#ckwanguan").bind("change",setWanguanCheck);   //弯管
		$("#ckchuankuay").bind("change", function(){setPointCheck("#ckchuankuay","chuankuay")}); 	//穿跨越
		$("#ckneichen").bind("change", function(){setPointCheck("#ckneichen","neichen")}); 			//内衬	
		$("#ckfushuss").bind("change", setFushussCheck);		//附属设施
		$("#ckyangji").bind("change",setYangjiCheck);			//阳极
		$("#ckceshiz").bind("change",setCeshizhuangCheck);		//测试桩
		$("#ckpailiuzz").bind("change",setPailiuzhuangzhiCheck);//排流装置			
		$("#ckshengchanyunxing").bind("change", setShengchanyunxingCheck); 	//生产运行
		$("#ckyichang").bind("change",setYichangCheck);		//异常			
		$("#ckteshuduan").bind("change",setTeshuduanCheck);	//特殊段
		$("#ckweizhangzhanya").bind("change",setWeizhangzhanyaCheck);	//违章占压
		$("#ckshengchanzuoye").bind("change", setShengchanzuoyeCheck); 	//生产作业
		$("#ckshengchanzuoyedian").bind("change",setShengchanzuoyedianCheck);	//生产作业点
		$("#ckdaiqizuoyejixieyuzhi").bind("change",setDaiqizuoyejixieyuzhijianCheck); //带气作业机械预制件
  		$("#ckshijian").bind("change", setShijianCheck); 	   //事件
		$("#ckshijiandian").bind("change",setShijiandianCheck);//事件点
    	$("#ckxieloudian").bind("change",setXieloudianCheck);  //泄漏点    	
    	$("#cktezhengdianjiancha").bind("change", function(){setPointCheck("#cktezhengdianjiancha","testtzhdjch")}); //特征点检查
    	$("#ckchuanyuejiancha").bind("change", function(){setPointCheck("#ckchuanyuejiancha","chyjch")}); 			//穿越检查
		$("#ckzhijiejiancha").bind("change", setZhijiejianchaCheck); 		//直接检查		
		$("#ckwaiguanjiancha").bind("change",setWaiguanjianchaCheck);	//外观检查
    	$("#ckbihoujiance").bind("change",setBihoujianceCheck);		//壁厚检测
    	$("#ckfangfucehoudujiance").bind("change",setFangfucenghoudujianceCheck);//防腐层厚度检测
    	$("#ckfangfucengposunjiance").bind("change",setFangfucengposunjianceCheck);//防腐层破损检测
    	$("#ckfushizhuangkuangjiance").bind("change",setFushizhuangkuangjianceCheck);//腐蚀状况检测
   		$("#ckshexianjiance").bind("change",setShexianjianceCheck);//射线检测   			
		$("#ckkuangxuan").bind("change", checkKuangxuan);		
		$("#ckdidianss").bind("change", checkDidianss);		
		$("#ckjiaotongll").bind("change", checkJiaotongll);
		$("#ckweixing").bind("change", checkWeixing);
		$("#ckzhuanxiangjiance").bind("change", setZhuanxiangjianceCheck); 	//专项检测
		$("#ckdaobojiance").bind("change",setDaobojianceCheck);	//导波检测		
    	$("#ckcijiyijiance").bind("change",setCijiyijianceCheck);//磁记忆检测   	
		$("#ckshunbiandiancijiance").bind("change",setShunbiandiancijianceCheck);//瞬变电磁检测		
		$("#cklihuajiance").bind("change", setLihuajianceCheck); //理化检测	
		$("#ckyinglishiyan").bind("change",setYinglishiyanCheck);//应力试验
    	$("#ckhuaxuechengfenfenxi").bind("change",setHuaxuechengfenfenxiCheck);//化学成分分析
    	$("#ckyingduceshi").bind("change",setYingduceshiCheck);  //硬度测试
    	$("#ckjinxiangfenxi").bind("change",setJinxiangfenxiCheck);//金相分析
    	$("#cklashenshiyan").bind("change",setLashenshiyanCheck);  //拉伸试验
    	$("#ckwanqushiyan").bind("change",setWanqushiyanCheck);    //弯曲试验
    	$("#ckchongjishiyan").bind("change",setChongjishiyanCheck);//冲击试验    		
		$("#ckxieloujiance").bind("change", setXieloujianceCheck); //泄漏检测		
		$("#ckjiancedian").bind("change",setJiancedianCheck);//检测点 		
    	$("#ckxieloujiancexieloudian").bind("change",setXieloujianceXieloudianCheck);//泄漏点		
		$("#ckfushifanghujiance").bind("change", setFushifanghujianceCheck);//腐蚀防护系统检测		
		$("#ckturangfushixingjiance").bind("change",setTurangfushixingjianceCheck);			//土壤腐蚀性检测		
    	$("#ckzasandianliujiance").bind("change",setZasandianliujianceCheck);			//杂散电流检测
  		//$("#ckfangfucengjueyuandianzu").bind("change",setFangfucengjueyuandianzuCheck);		//防腐层绝缘电阻
  		$("#ckfangfucengjiancedian").bind("change",setFangfucengjiancedianCheck);			//防腐层检测点
  		$("#ckfangfucengposundian").bind("change",setFangfucengposundianCheck);			//防腐层破损点
  		$("#ckceshizhuangjiance").bind("change",setCeshizhuangjianceCheck);				//测试桩检测
  		//$("#ckyinjibaohuxiaoguojiance").bind("change",setYinjibaohuxiaoguojianceCheck);		//阴极保护效果检测
    	$("#ckyinjibaohumijiangejiancedian").bind("change",setYinjibaohumijiancejiancedianCheck);	//阴极保护密间隔检测点	
    	
    	//$("#ckditubj").bind("change",setDitubj);	//地图背景
    	/*$("#ckditubjNormal").bind("change",setDitubjNormal);	//地图背景默认地图样式
    	$("#ckditubjGrayscale").bind("change",setDitubjGrayscale);	//地图背景高端灰风格
    	$("#ckditubjDark").bind("change",setDitubjDark);	//地图背景黑夜风格
    	$("#ckditubjLight").bind("change",setDitubjLight);	//地图背景清新蓝风格
  		*/
	});
	
	function refreshtreebyJijiangdaoqi()
	{		
		refreshtreebyDaojian("jijiangdaoqi");
	}
	function refreshtreebyChaoqi()
	{
		refreshtreebyDaojian("chaoqi");
	}
	//到检提醒
	function refreshtreebyDaojian(type){
		var params;
		var actionUrl="<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByDaojian.action?type="+type;	
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      data : params,  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) { 	     
		          alert("系统ajax交互错误: " + textStatus.value); 
		      },  
		      success : function(data, textStatus) {		      	
		      	var settingkey = {
					check: {
				        enable: true
					    },
					data: {
					        simpleData: {
					        enable: true
					        }
					    },
					callback: {
						onClick: zTreeOnClick,
						onDblClick: zTreeOnDblClick,
						beforeAsync: beforeAsync,
						onAsyncSuccess: onAsyncSuccess,
						onAsyncError: onAsyncError,
						onCheck: zTreeOnCheck,
						onExpand: zTreeOnExpand
					},
					view: {
						fontCss: getFontCss
					}
				};
		      	$.fn.zTree.init($("#treeDemo"), settingkey,data.treedata);
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				
				//展开管线根节点
				var node = zTree.getNodeByParam('id','guanxianroot',null);
				if (node != null) {
					zTree.expandNode(node, true, false, true);	
				}	
				treeObj.checkAllNodes(true);
				treeObj.refresh();
				//更新表格
				/*if(paraObj.owner=='pipeLineSearch')
				{			
				   document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pipeLineList.jsp?pipelinenos="+pipelinenos;
				   $("#tableframe").slideDown();		
				}*/		
				document.getElementById("mapcontent").contentWindow.removeGuanduanAll();		
				//document.getElementById("mapcontent").contentWindow.showGuanduanlines(data.guanduandata);
		   		document.getElementById("mapcontent").contentWindow.showGuanduanlinesdaojian(data.guanduandata,type);
		    }  
		});
	}
	//刷新树
	function refreshtreebykey(searchtype,paraObj,guanduandata,pipelinenos){
		var params;
		var actionUrl;
		if (searchtype=='zuobiaodw'){
			params = {
					"jingdu": paraObj.jingdu,
					"weidu": paraObj.weidu,
					"juli": paraObj.juli,
					"zuobiaox": paraObj.zuobiaox,
					"zuobiaoy": paraObj.zuobiaoy,
					"julixy": paraObj.julixy
			}; 
			actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByZuobiao.action"; 
		}
		else if (searchtype=='kuangxuan'){
			params = {
					"a1": paraObj.a1,
					"a2": paraObj.a2,
					"b1": paraObj.b1,
					"b2": paraObj.b2
			}; 
			actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByKuangxuan.action"; 
		}
		else if(searchtype=='guanduansearch')
		{		
			var owner=paraObj.owner;
			var params = {
					"kfieldname":paraObj.kfieldname,
					"kfieldvalue":paraObj.kfieldvalue,				
					"sfieldvalue":paraObj.sfieldvalue,
					"sfieldname":paraObj.sfieldname,
					"rfieldname":paraObj.rfieldname,
					"rfieldvalue1":paraObj.rfieldvalue1,
					"rlimit1":paraObj.rlimit1,
					"rfieldvalue2":paraObj.rfieldvalue2,
					"rlimit2":paraObj.rlimit2,
					"dfieldname":paraObj.dfieldname,
					"dfieldvalue1":paraObj.dfieldvalue1,
					"dfieldvalue2":paraObj.dfieldvalue2,
					"owner":paraObj.owner
					}; 	
			if(owner=='pipeLineSearch')
			{
			 actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByAutosearch.action?kfieldname="+encodeURIComponent(paraObj.kfieldname)+"&kfieldvalue="+encodeURIComponent(paraObj.kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(paraObj.sfieldvalue))+"&sfieldname="+encodeURIComponent(paraObj.sfieldname)+"&rfieldname="+encodeURIComponent(paraObj.rfieldname)+"&rfieldvalue1="+encodeURIComponent(paraObj.rfieldvalue1)+"&rlimit1="+paraObj.rlimit1+"&rfieldvalue2="+encodeURIComponent(paraObj.rfieldvalue2)+"&rlimit2="+paraObj.rlimit2+"&dfieldname="+encodeURIComponent(paraObj.dfieldname)+"&dfieldvalue1="+paraObj.dfieldvalue1+"&dfieldvalue2="+paraObj.dfieldvalue2+"&owner="+encodeURIComponent(paraObj.owner); 			
			}		
			if(owner=='pipeSectionSearch')
			{
			 actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByAutosearchPipeSection.action?kfieldname="+encodeURIComponent(paraObj.kfieldname)+"&kfieldvalue="+encodeURIComponent(paraObj.kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(paraObj.sfieldvalue))+"&sfieldname="+encodeURIComponent(paraObj.sfieldname)+"&rfieldname="+encodeURIComponent(paraObj.rfieldname)+"&rfieldvalue1="+encodeURIComponent(paraObj.rfieldvalue1)+"&rlimit1="+paraObj.rlimit1+"&rfieldvalue2="+encodeURIComponent(paraObj.rfieldvalue2)+"&rlimit2="+paraObj.rlimit2+"&dfieldname="+encodeURIComponent(paraObj.dfieldname)+"&dfieldvalue1="+paraObj.dfieldvalue1+"&dfieldvalue2="+paraObj.dfieldvalue2+"&owner="+encodeURIComponent(paraObj.owner); 			
			}
			if(owner=='TaskSearch')
			{
			 actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByAutosearchTask.action?kfieldname="+encodeURIComponent(paraObj.kfieldname)+"&kfieldvalue="+encodeURIComponent(paraObj.kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(paraObj.sfieldvalue))+"&sfieldname="+encodeURIComponent(paraObj.sfieldname)+"&rfieldname="+encodeURIComponent(paraObj.rfieldname)+"&rfieldvalue1="+encodeURIComponent(paraObj.rfieldvalue1)+"&rlimit1="+paraObj.rlimit1+"&rfieldvalue2="+encodeURIComponent(paraObj.rfieldvalue2)+"&rlimit2="+paraObj.rlimit2+"&dfieldname="+encodeURIComponent(paraObj.dfieldname)+"&dfieldvalue1="+paraObj.dfieldvalue1+"&dfieldvalue2="+paraObj.dfieldvalue2+"&owner="+encodeURIComponent(paraObj.owner); 			
			}
			if(owner=='pipePointSearch')
			{
			 actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByAutosearchPipePoint.action?kfieldname="+encodeURIComponent(paraObj.kfieldname)+"&kfieldvalue="+encodeURIComponent(paraObj.kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(paraObj.sfieldvalue))+"&sfieldname="+encodeURIComponent(paraObj.sfieldname)+"&rfieldname="+encodeURIComponent(paraObj.rfieldname)+"&rfieldvalue1="+encodeURIComponent(paraObj.rfieldvalue1)+"&rlimit1="+paraObj.rlimit1+"&rfieldvalue2="+encodeURIComponent(paraObj.rfieldvalue2)+"&rlimit2="+paraObj.rlimit2+"&dfieldname="+encodeURIComponent(paraObj.dfieldname)+"&dfieldvalue1="+paraObj.dfieldvalue1+"&dfieldvalue2="+paraObj.dfieldvalue2+"&owner="+encodeURIComponent(paraObj.owner); 			
			}
		}
		else{
			params = {
					"fieldname": paraObj.fieldname,
					"fieldvalue":paraObj.fieldvalue
			}; 
			actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeByKeyvalue.action";  
		}
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      data : params,  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) { 	     
		          alert("系统ajax交互错误: " + textStatus.value); 
		      },  
		      success : function(data, textStatus) {
		      	
		      	var settingkey = {
					check: {
				        enable: true
					    },
					data: {
					        simpleData: {
					        enable: true
					        }
					    },
					callback: {
						onClick: zTreeOnClick,
						onDblClick: zTreeOnDblClick,
						beforeAsync: beforeAsync,
						onAsyncSuccess: onAsyncSuccess,
						onAsyncError: onAsyncError,
						onCheck: zTreeOnCheck,
						onExpand: zTreeOnExpand
					},
					view: {
						fontCss: getFontCss
					}
				};
				$.fn.zTree.init($("#treeDemo"), settingkey,data);
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				//if(searchtype=='guanduansearch')
				{
					//展开管线根节点
					//var node = zTree.getNodeByParam('id','guanxianroot',null);
					var node = zTree.getNodeByParam('id','guanxianrootR',null);
					if (node != null) {
						zTree.expandNode(node, true, false, true);	
						treeObj.checkNode(node,true,true,true);
					}		
				}			
				treeObj.refresh();
				//更新表格
				if(paraObj.owner=='pipeLineSearch')
				{			
				   //alert(pipelinenos);
				   document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pipeLineList.jsp?pipelinenos="+pipelinenos;
				   $("#tableframe").slideDown();		
				}
				if(paraObj.owner=='pipeSectionSearch')
				{			
				   //document.getElementById('tableframe').src ='';
				   //document.getElementById('tableForm').target='tableframe';
				   //document.getElementById('pipesectionnos').value = pipelinenos;
				   //document.getElementById('tableForm').action='<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid=4861'; 
				   //document.getElementById('tableForm').submit(); 
				   
				   document.getElementById("tableframe").src =
				    "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				    +4861+"&owner="+paraObj.owner;
				   $("#tableframe").slideDown();	
				}
				if(paraObj.owner=='TaskSearch')
				{			
				   document.getElementById("tableframe").src =
				    "<%=request.getContextPath() %>/frame/auto!gotoListQuery.action?formid="
				    +4848+"&owner="+paraObj.owner;
				   $("#tableframe").slideDown();	
				}
				if (searchtype!='zuobiaodw'&&searchtype!='kuangxuan')
				{
					//清除地图上的管线
					document.getElementById("mapcontent").contentWindow.removeGuanduanAll();		
					//在地图上画管线
					//document.getElementById("mapcontent").contentWindow.showGuanduanlines(guanduandata);			   		
				}
				/*if(searchtype=='guanduansearch')
				{			
				   //alert(pipelinenos);
				   document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pipeLineList.jsp?pipelinenos="+pipelinenos;
				   $("#tableframe").slideDown();		
				}*/		
		    }  
		});
	}
	//任务查询
   function refreshtreebyTaskSearch(kfieldname,kfieldvalue,sfieldname,sfieldvalue,rfieldname,rfieldvalue1,rlimit1,rfieldvalue2,rlimit2,dfieldname,dfieldvalue1,dfieldvalue2){						
		var  testParam=kfieldname;
		var params = {
					"kfieldname1":kfieldname,
					"kfieldvalue":encodeURIComponent($.trim(kfieldvalue)),				
					"sfieldvalue":sfieldvalue,
					"sfieldname":sfieldname,
					"rfieldname":rfieldname,
					"rfieldvalue1":rfieldvalue1,
					"rlimit1":rlimit1,
					"rfieldvalue2":rfieldvalue2,
					"rlimit2":rlimit2,
					"dfieldname":dfieldname,
					"dfieldvalue1":dfieldvalue1,
					"dfieldvalue2":dfieldvalue2
					};  
		var actionUrl = "<%=request.getContextPath() %>/pipePointAction!getGuanxianListByTaskSearch.action";
	
	$.ajax({  
		  url : actionUrl,  
		  data : params, 
	      type : "post",   
	      dataType : "json", 
	  
	      cache : false,  
	      error : function(textStatus, errorThrown) {  
	          alert("ç³»ç»ajaxäº¤äºéè¯¯: " + textStatus.value);  
	      },  
	      success : function(data, textStatus) {
	      	//æç®¡æ®µä¿¡æ¯æ¾ç¤ºå°é¡µé¢ä¸
	      	document.getElementById("mapcontent").contentWindow.showGuanduanlines(data.guanduandata);
	      	//æè¾å¥çç®¡æ®µä¿¡æ¯ç»å
	      	//document.getElementById("mapcontent").contentWindow.drawCircle(data.jingdu,data.weidu,data.juli);
   	var obj = new Object();
	      	obj.kfieldname = kfieldname;
	      	obj.kfieldvalue = kfieldvalue;
	      	obj.sfieldvalue = sfieldvalue;
	      	obj.sfieldname = sfieldname;
	      	obj.rfieldname = rfieldname;
	      	obj.rfieldvalue1 = rfieldvalue1;
	      	obj.rlimit1 = rlimit1;
	      	obj.rfieldvalue2 = rfieldvalue2;
	      	obj.rlimit2 = rlimit2;
	      	obj.dfieldname = dfieldname;
	      	obj.dfieldvalue1 = dfieldvalue1;
	      	obj.dfieldvalue2 = dfieldvalue2;
	      	refreshtreebykey('guanduansearch',obj);
	    }  
	});  
		
	} 
	
	
	
	
	
   //自定义查询
   function refreshtreebyAutosearch(kfieldname,kfieldvalue,sfieldname,sfieldvalue,rfieldname,rfieldvalue1,rlimit1,rfieldvalue2,rlimit2,dfieldname,dfieldvalue1,dfieldvalue2,owner){							
		document.getElementById("mapcontent").contentWindow.removeThumbGuanduanAll();
	    		
		var actionUrl;
		var params = {
					"kfieldname":kfieldname,
					"kfieldvalue":kfieldvalue,				
					"sfieldvalue":sfieldvalue,
					"sfieldname":sfieldname,
					"rfieldname":rfieldname,
					"rfieldvalue1":rfieldvalue1,
					"rlimit1":rlimit1,
					"rfieldvalue2":rfieldvalue2,
					"rlimit2":rlimit2,
					"dfieldname":dfieldname,
					"dfieldvalue1":dfieldvalue1,
					"dfieldvalue2":dfieldvalue2,
					"owner":owner
					};  
			if(owner=='pipeLineSearch')
			{
			 actionUrl =  "<%=request.getContextPath() %>/guanxianAction!getCoordinate.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(sfieldvalue))+"&sfieldname="+encodeURIComponent(sfieldname)+"&rfieldname="+encodeURIComponent(rfieldname)+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+encodeURIComponent(dfieldname)+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2+"&owner="+owner;
			}		
			if(owner=='pipeSectionSearch')
			{
			 actionUrl =  "<%=request.getContextPath() %>/guanxianAction!getCoordinatePipeSection.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(sfieldvalue))+"&sfieldname="+encodeURIComponent(sfieldname)+"&rfieldname="+encodeURIComponent(rfieldname)+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+encodeURIComponent(dfieldname)+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2+"&owner="+owner;
			}		
			if(owner=='TaskSearch')
			{
			 actionUrl =  "<%=request.getContextPath() %>/guanxianAction!getCoordinateTask.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(sfieldvalue))+"&sfieldname="+encodeURIComponent(sfieldname)+"&rfieldname="+encodeURIComponent(rfieldname)+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+encodeURIComponent(dfieldname)+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2+"&owner="+owner;
			}	
			if(owner=='pipePointSearch')
			{
			 actionUrl =  "<%=request.getContextPath() %>/guanxianAction!getCoordinatePipePoint.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(sfieldvalue))+"&sfieldname="+encodeURIComponent(sfieldname)+"&rfieldname="+encodeURIComponent(rfieldname)+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+encodeURIComponent(dfieldname)+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2+"&owner="+owner;
			}		
			//var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getCoordinate.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+encodeURIComponent(encodeURIComponent(sfieldvalue))+"&sfieldname="+encodeURIComponent(sfieldname)+"&rfieldname="+encodeURIComponent(rfieldname)+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+encodeURIComponent(dfieldname)+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2+"&owner="+owner;
	
	$.ajax({  
		  url : actionUrl,  
	      type : "post",   
	      dataType : "json",  
	      cache : false,  
	      error : function(textStatus, errorThrown) {  
	      	
	      	  alert("交互错误：" + textStatus.value);  
	      	  
	      },  
	      success : function(data, textStatus) {
	     	 if(data==null)
	      		{
	      			alert("未查询到数据");
	      		}
	      	var obj = new Object();
	      	obj.kfieldname = kfieldname;
	      	obj.kfieldvalue = kfieldvalue;
	      	obj.sfieldvalue = sfieldvalue;
	      	obj.sfieldname = sfieldname;
	      	obj.rfieldname = rfieldname;
	      	obj.rfieldvalue1 = rfieldvalue1;
	      	obj.rlimit1 = rlimit1;
	      	obj.rfieldvalue2 = rfieldvalue2;
	      	obj.rlimit2 = rlimit2;
	      	obj.dfieldname = dfieldname;
	      	obj.dfieldvalue1 = dfieldvalue1;
	      	obj.dfieldvalue2 = dfieldvalue2;
	      	obj.owner=owner;	      	  
	      	refreshtreebykey('guanduansearch',obj,data.guanduandata,data.pipelinenos);	         
	        //document.getElementById("mapcontent").contentWindow.showGuanduanlines(data.guanduandata);
	    }  
	});  
		
	} 
	
	//管段查询
   function refreshtreebyguanduansearch(kfieldname,kfieldvalue,sfieldname,sfieldvalue,rfieldname,rfieldvalue1,rlimit1,rfieldvalue2,rlimit2,dfieldname,dfieldvalue1,dfieldvalue2){							
	
		var params = {
					"kfieldname":kfieldname,
					"kfieldvalue":kfieldvalue,				
					"sfieldvalue":sfieldvalue,
					"sfieldname":sfieldname,
					"rfieldname":rfieldname,
					"rfieldvalue1":rfieldvalue1,
					"rlimit1":rlimit1,
					"rfieldvalue2":rfieldvalue2,
					"rlimit2":rlimit2,
					"dfieldname":dfieldname,
					"dfieldvalue1":dfieldvalue1,
					"dfieldvalue2":dfieldvalue2
					};  				
		var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanxianListByguanduansearch.action?kfieldname="+encodeURIComponent(kfieldname)+"&kfieldvalue="+encodeURIComponent(kfieldvalue)+"&sfieldvalue="+sfieldvalue+"&sfieldname="+sfieldname+"&rfieldname="+rfieldname+"&rfieldvalue1="+rfieldvalue1+"&rlimit1="+rlimit1+"&rfieldvalue2="+rfieldvalue2+"&rlimit2="+rlimit2+"&dfieldname="+dfieldname+"&dfieldvalue1="+dfieldvalue1+"&dfieldvalue2="+dfieldvalue2;
	
	$.ajax({  
		  url : actionUrl,  
	      type : "post",   
	      dataType : "json",  
	      cache : false,  
	      error : function(textStatus, errorThrown) {  
	          alert("交互错误：" + textStatus.value);  
	      },  
	      success : function(data, textStatus) {
	  		document.getElementById("mapcontent").contentWindow.showGuanduanlines(data.guanduandata);
			var obj = new Object();
	      	obj.kfieldname = kfieldname;
	      	obj.kfieldvalue = kfieldvalue;
	      	obj.sfieldvalue = sfieldvalue;
	      	obj.sfieldname = sfieldname;
	      	obj.rfieldname = rfieldname;
	      	obj.rfieldvalue1 = rfieldvalue1;
	      	obj.rlimit1 = rlimit1;
	      	obj.rfieldvalue2 = rfieldvalue2;
	      	obj.rlimit2 = rlimit2;
	      	obj.dfieldname = dfieldname;
	      	obj.dfieldvalue1 = dfieldvalue1;
	      	obj.dfieldvalue2 = dfieldvalue2;
	      	refreshtreebykey('guanduansearch',obj);
	    }  
	});  
		
	} 
    function checkKuangxuan(){
    	if (!$("#ckkuangxuan").attr("checked")){
    		document.getElementById("mapcontent").contentWindow.removeKuangxuan();
    	}
    }
    
    function checkJiaotongll(){
    	if ($("#ckjiaotongll").attr("checked")){
    		document.getElementById("mapcontent").contentWindow.showJiaotongll();
    	}
    	else{
    		document.getElementById("mapcontent").contentWindow.removeJiaotongll();
    	}
    }
    
    function checkWeixing(){
    	if ($("#ckweixing").attr("checked")){
    		document.getElementById("mapcontent").contentWindow.showweixing();
    	}
    	else{
    		document.getElementById("mapcontent").contentWindow.removeweixing();
    	}
    }

    function showceju(){
    	document.getElementById("mapcontent").contentWindow.showCeju();
    }
    
    //地点搜索
    function checkDidianss(){
    	if ($("#ckdidianss").attr("checked")){
    		$("#searchpanel").slideDown();
    	}
    	else{
    		$("#searchpanel").slideUp();
    	}
    }

    function searchDidian(){
    	var didian = document.getElementById("searchtext").value;
    	document.getElementById("mapcontent").contentWindow.searchDidian(didian);
    } 
    
    function removemapmarks(type){
    	var ids;
		var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
        var nodes = treeObj.transformToArray(treeObj.getNodes());
        var ids=new Array();
        var index=0;
		for(var i=0;i<nodes.length;i++)
		{
			var node=nodes[i];			
			var treeid = node.id;
			var isParent=node.isParent;	
			if(type=="tezhengd")
			{
				type="tz";
				if(treeid!=0&&isParent!=true&&treeid.indexOf(type)>=0)
				{
					ids[index]=treeid;
					index++;
				}  
			}	
			else if(type=="zhxjc")
			{
				var type1="dbjc";
				var type2="cjyjc";
				var type3="shbdcjc";
				if(treeid!=0&&isParent!=true&&(treeid.indexOf(type1)>=0||treeid.indexOf(type2)>=0)||treeid.indexOf(type3)>=0)
				{
					ids[index]=treeid;
					index++;
				}  
			}	
			else
			{
				if(treeid!=0&&isParent!=true&&treeid.indexOf(type)>=0)
				{
					ids[index]=treeid;
					index++;
				}     
			}	
			 		
		} 		
		document.getElementById("mapcontent").contentWindow.removemarks(ids);
    }
    //显示点
    function setPointCheckParent(id,idArr,typeArr){  	
     	if ($(id).attr("checked")){
        	isCheckedTemp=true;
        }
        else
        {
        	isCheckedTemp=false;	
        }
    	 var clickid=id; 
    	 var ids=new Array();
    	 ids=idArr.split(",");
    	 var types=new Array();
    	 types=typeArr.split(",");
    	 g_type=typeArr;
    	 isLoading=true;
    	 var treeObj=$.fn.zTree.getZTreeObj("treeDemo"),  	 	 
         nodes=treeObj.getCheckedNodes(true),
         gxchecked=""; //选中的管线
         var isCheckedTemp;
         for(var i=0;i<nodes.length;i++){
         	var nodeid=nodes[i].id;
         	if(nodeid.substring(0,2)=="gx")
         	{
         		gxchecked+=nodeid.substring(2,nodeid.length) + ",";
         	}             	
        }
        if(gxchecked=="")
        {
        	alert("请选择管线"); 
        	//$("#id").attr("checked",!$("#id").attr("checked"));
        	$(id).attr("checked",false);
        	if(id==ids[0])
        	{
	        	for(var i=0;i<ids.length;i++)
	        	{
	        		var idtemp=ids[i];
	        		$(idtemp).attr("checked",false);
	        	}
        	}          
        	return;
        }
        document.getElementById("gxchecked").value =gxchecked; 
       
       for(var i=0;i<ids.length;i++)
        {
        	var id=ids[i];
        	var type=types[i];
	        //勾选   
			if ($(id).attr("checked")){
				document.getElementById("nodetypes").value = document.getElementById("nodetypes").value.replace(type,"");
				document.getElementById("nodetypes").value = document.getElementById("nodetypes").value+type+",";
				isChecked=true;	
				//isCheckedTemp=true;	
			}
			//取消勾选
			else{		
				document.getElementById("nodetypes").value = document.getElementById("nodetypes").value.replace(type,"");
				document.getElementById("tableframe").src = "";
				removemapmarks(type);
				$("#tableframe").slideUp();
				isChecked=true;
			}		
        }        
      	//refreshByType();
		//refreshByGxChecked();
		refreshByTypeGxChecked(isCheckedTemp,clickid);
	}
    //显示点
    function setPointCheck(id,type){ 
    	 g_type=type;
    	 isLoading=true;
    	 var treeObj=$.fn.zTree.getZTreeObj("treeDemo"),  	 	 
         nodes=treeObj.getCheckedNodes(true),
         gxchecked=""; //选中的管线
         for(var i=0;i<nodes.length;i++){
         	var nodeid=nodes[i].id;
         	if(nodeid.substring(0,2)=="gx")
         	{
         		gxchecked+=nodeid.substring(2,nodeid.length) + ",";
         	}             	
        }
        if(gxchecked=="")
        {
        	alert("请选择管线");  
        	$(id).attr("checked",false);        
        	return;
        }
        document.getElementById("gxchecked").value =gxchecked; 
        var isCheckedTemp;
        //勾选   
		if ($(id).attr("checked")){
			document.getElementById("nodetypes").value = document.getElementById("nodetypes").value.replace(type,"");
			document.getElementById("nodetypes").value = document.getElementById("nodetypes").value+type+",";
			isChecked=true;	
			isCheckedTemp=true;	
		}
		//取消勾选
		else{		
			document.getElementById("nodetypes").value = document.getElementById("nodetypes").value.replace(type,"");
			document.getElementById("tableframe").src = "";
			removemapmarks(type);
			$("#tableframe").slideUp();
			isChecked=true;
			isCheckedTemp=false;
		}		
		//refreshByGxChecked();
		refreshByTypeGxChecked(isCheckedTemp,id);
		//refreshByType();
	}
  
     /*function refreshByType(){
    	var settingtype = {
			check: {
		        enable: true
			    },
			data: {
			        simpleData: {
			            enable: true
			        }
			    },
			async: {
				enable: true,
				url:"<%=request.getContextPath() %>/guanxianAction!getGuanxianTree.action",
				autoParam:["id"],
				otherParam:{"nodetypes":document.getElementById("nodetypes").value},
				dataFilter: filter,
				dataType : "text",
				type: "get"
			},
			callback: {
				onClick: zTreeOnClick,
				onDblClick: zTreeOnDblClick,
				beforeAsync: beforeAsync,
				onAsyncSuccess: onAsyncSuccess,
				onAsyncError: onAsyncError,
				onCheck: zTreeOnCheck
			},
			view: {
				fontCss: getFontCss
			}
		};
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	$.fn.zTree.init($("#treeDemo"), settingtype,zTreeNodes);
		treeObj.refresh();
    }*/
    function refreshByGxChecked(){
      	 //获取未选中的节点
    	 var treeObj=$.fn.zTree.getZTreeObj("treeDemo");	 	 
         nodes=treeObj.getCheckedNodes(false);  
         for(var i=0;i<nodes.length;i++){
         	var nodeid=nodes[i].id;
         	isNodeChecked[nodeid]=false;       	
        }
    	//alert(isNodeChecked);
    	isToExpand=true;
    	var settingtype = {
			check: {
		        enable: true
			    },
			data: {
			        simpleData: {
			            enable: true
			        }
			    },
			async: {
				enable: true,
				url:"<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeTypeGxChecked.action",
				autoParam:["id"],
				otherParam:{"nodetypes":document.getElementById("nodetypes").value,"gxchecked":document.getElementById("gxchecked").value},
				dataFilter: filter,
				dataType : "text",
				type: "get"
			},
			callback: {
				onClick: zTreeOnClick,
				onDblClick: zTreeOnDblClick,
				beforeAsync: beforeAsync,
				onAsyncSuccess: onAsyncSuccess,
				onAsyncError: onAsyncError,
				onCheck: zTreeOnCheck,
				onExpand: zTreeOnExpand
			},
			view: {
				fontCss: getFontCss
			}
		};
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	$.fn.zTree.init($("#treeDemo"), settingtype,zTreeNodes);
    	zTree = $.fn.zTree.getZTreeObj("treeDemo");
			var node = zTree.getNodeByParam('id','0',null);
			if (node != null) {
				zTree.expandNode(node, true, true, true);
			}	
    }
    //任务查询后结构树上移除未选管线节点
    function removeUncheckedPipelineTask(zTree,num,pipelinearr)
    {
    	var nodes = zTree.transformToArray(zTree.getNodes());
    	var nodeids="";	       
		for(var i=0;i<nodes.length;i++)
		{
			var nodeid = nodes[i].id;
			if(nodeid.indexOf("rootgx")!=-1)
			{
				nodeids+=nodeid;
				nodeids+=",";
			}
		}
		if(nodeids=="")
		{
			return;
		}
		nodeids=nodeids.substring(0,nodeids.length-1);
		var nodeidarr=nodeids.split(",");
		var length=nodeidarr.length;
		for(var i=0;i<length;i++)
		{
			var guanxianroot=zTree.getNodeByParam('id',nodeidarr[i],null);
	    	if(guanxianroot==null)
	    	{
	    		removeUncheckedPipelineTask(zTree,num,pipelinearr);
	    	}
			var nodes=guanxianroot.children;
			//var numall=nodes.length;
			var nodeids="";
			//查找节点
			for(var i=0;i<nodes.length;i++)
			{
				var node=nodes[i];
				var nodeid=node.id;
				var pipelineno=nodeid.substring(2,nodeid.length);
				var j=0;
				for(j=0;j<num;j++)
				{
					if(pipelineno==pipelinearr[j])
					{
						break;
					}
				}
				if(j==num)
				{
					nodeids+=nodeid;
					nodeids+=",";
					//zTree.removeNode(node,true);
				}
			}
			//移除节点
			nodeids=nodeids.substring(0,nodeids.length-1);
			var nodeidarr=nodeids.split(",");
			var length=nodeidarr.length;
			for(var i=0;i<length;i++)
			{
				var nodeid=nodeidarr[i];
				var node=zTree.getNodeByParam('id',nodeid,null);
				zTree.removeNode(node,true);
			}
			//更新管线根节点名称
			/*guanxianroot=zTree.getNodeByParam('id','guanxianroot',null);
			var num=guanxianroot.children.length;
			guanxianroot.name="管线"+"-"+num;
			zTree.updateNode(guanxianroot);*/
		}
    }
    //结构树上移除未选管线节点
    function removeUncheckedPipeline(zTree,num,pipelinearr)
    {
    	var guanxianroot=zTree.getNodeByParam('id','guanxianrootR',null);
    	if(guanxianroot==null)
    	{
    		removeUncheckedPipelineTask(zTree,num,pipelinearr);
    		return;
    	}
		var nodes=guanxianroot.children;
		//var numall=nodes.length;
		var nodeids="";
		//查找节点
		for(var i=0;i<nodes.length;i++)
		{
			var node=nodes[i];
			var nodeid=node.id;
			var pipelineno=nodeid.substring(2,nodeid.length);
			var j=0;
			for(j=0;j<num;j++)
			{
				if(pipelineno==pipelinearr[j])
				{
					break;
				}
			}
			if(j==num)
			{
				nodeids+=nodeid;
				nodeids+=",";
				//zTree.removeNode(node,true);
			}
		}
		//移除节点
		nodeids=nodeids.substring(0,nodeids.length-1);
		var nodeidarr=nodeids.split(",");
		var length=nodeidarr.length;
		for(var i=0;i<length;i++)
		{
			var nodeid=nodeidarr[i];
			var node=zTree.getNodeByParam('id',nodeid,null);
			zTree.removeNode(node,true);
		}
		//更新管线根节点名称
		guanxianroot=zTree.getNodeByParam('id','guanxianrootR',null);
		var num=guanxianroot.children.length;
		guanxianroot.name="管线"+"-"+num;
		zTree.updateNode(guanxianroot);
    }
    //展开勾选节点
    function expendCheckNode(zTree){
    	var nodes = zTree.transformToArray(zTree.getNodes());		       
		for(var i=0;i<nodes.length;i++)
		{
			var node=nodes[i];			
			var treeid = node.id;			
			types=g_type.split(",");						
			var length=types.length;
			var j=0;
			for(j=0;j<length;j++)
			{
				var type=types[j];
				if(type=="tezhengd")
				{
					type="tz";
				}
				if(treeid.indexOf(type)>=0)
				{
					break;
				}
			}
			if(j<length)
			{				
				zTree.checkNode(node,true,true,true);
				if(node.isParent==true)
				{
					zTree.expandNode(node, true, true, true);	
					var nodesTemp = zTree.getNodesByParam("pId", node.id, null);							
					var num=nodesTemp.length;
					if(node.name.indexOf("-")==-1&&node.id.indexOf("gx")==-1)
					{
						node.name=node.name+"-"+num;
						zTree.updateNode(node);
					}
					//alert(treeid);					
					zTree.checkNode(node,true,true);
				}				
			}			  
		}			      		
    }
    //获取某类型根节点名称
    function getNodeRootName(id){
    	//特征点
    	if(id=="#cktezhengd")
    	{
    		return "tzroot";
    	}
    	//管件
    	else if(id=="#ckguanjian")
    	{
    		return "guanjianroot";
    	}
    	//三通
    	else if(id=="#cksantong")
    	{
    		return "pointTeeRoot";
    	}
    	//套管
    	else if(id=="#cktaoguan")
    	{
    		return "taoguanRoot";
    	}
    	//弯管
    	else if(id=="#ckwanguan")
    	{
    		return "wanguanRoot";
    	}
    	//阳极
    	else if(id=="#ckyangji")
    	{
    		return "pointAnodeRoot";
    	}
    	//测试桩
    	else if(id=="#ckceshiz")
    	{
    		return "pointPoleRoot";
    	}
    	//排流装置
    	else if(id=="#ckpailiuzz")
    	{
    		return "pointDrainageRoot";
    	}
    	//生产运行
    	else if(id=="#ckshengchanyunxing")
    	{
    		return "shchyxRoot";
    	}
    	//违章占压
    	else if(id=="#ckweizhangzhanya")
    	{
    		return "wzzyRoot";
    	}
    	//生产作业
    	else if(id=="#ckshengchanzuoye")
    	{
    		return "shchzyRoot";
    	}
    	//生产作业点
    	else if(id=="#ckshengchanzuoyedian")
    	{
    		return "shengchanzydRoot";
    	}
    	//带气作业机械预制件
    	else if(id=="#ckdaiqizuoyejixieyuzhi")
    	{
    		return "dqzyjxyzhRoot";
    	}
    	//事件点
    	else if(id=="#ckshijiandian")
    	{
    		return "sjdRoot";
    	}
    	//泄漏点
    	else if(id=="#ckxieloudian")
    	{
    		return "xldRoot";
    	}
    	//特征点检查
    	else if(id=="#cktezhengdianjiancha")
    	{
    		return "testtzhdjchRoot";
    	}
    	//穿越检查
    	else if(id=="#ckchuanyuejiancha")
    	{
    		return "chyjchRoot";
    	}
    	//直接检查
    	else if(id=="#ckzhijiejiancha")
    	{
    		return "zhjjchRoot";
    	}
    	//外观检查
    	else if(id=="#ckwaiguanjiancha")
    	{
    		return "wgjchRoot";
    	}
    	//壁厚检测
    	else if(id=="#ckbihoujiance")
    	{
    		return "bhjcRoot";
    	}
    	//防腐层厚度检测
    	else if(id=="#ckfangfucehoudujiance")
    	{
    		return "ffchdjcRoot";
    	}
    	//防腐层破损检测
    	else if(id=="#ckfangfucengposunjiance")
    	{
    		return "ffcpsjcRoot";
    	}
    	//腐蚀状况检测
    	else if(id=="#ckfushizhuangkuangjiance")
    	{
    		return "fshzhkjcRoot";
    	}
    	//射线检测 
    	else if(id=="#ckshexianjiance")
    	{
    		return "shexianjcRoot";
    	}
    	//专项检测
    	else if(id=="#ckzhuanxiangjiance")
    	{
    		return "zhxjcRoot";
    	}
    	//导波检测
    	else if(id=="#ckdaobojiance")
    	{
    		return "dbjcRoot";
    	}
    	//磁记忆检测
    	else if(id=="#ckcijiyijiance")
    	{
    		return "cjyjcRoot";
    	} 
    	//瞬变电磁检测
    	else if(id=="#ckshunbiandiancijiance")
    	{
    		return "shbdcjcRoot";
    	} 
		//理化检测
		else if(id=="#cklihuajiance")
    	{
    		return "lhjcRoot";
    	}
    	//应力试验
    	else if(id=="#ckyinglishiyan")
    	{
    		return "ylshyRoot";
    	}
    	//化学成分分析
    	else if(id=="#ckhuaxuechengfenfenxi")
    	{
    		return "hxchffxRoot";
    	}
    	//硬度测试
    	else if(id=="#ckyingduceshi")
    	{
    		return "ydcshRoot";
    	}
    	//金相分析
    	else if(id=="#ckjinxiangfenxi")
    	{
    		return "jxfxRoot";
    	}
    	//拉伸试验
    	else if(id=="#cklashenshiyan")
    	{
    		return "lshshyRoot";
    	}
    	//弯曲试验
    	else if(id=="#ckwanqushiyan")
    	{
    		return "wqshiyRoot";
    	}
    	//冲击试验 
    	else if(id=="#ckchongjishiyan")
    	{
    		return "chjshyRoot";
    	}
		//泄漏检测
		else if(id=="#ckxieloujiance")
    	{
    		return "xljcRoot";
    	}
    	//检测点 
    	else if(id=="#ckjiancedian")
    	{
    		return "xljcjcdRoot";
    	}
    	//泄漏点
    	else if(id=="#ckxieloujiancexieloudian")
    	{
    		return "xljcxldRoot";
    	}
		//腐蚀防护系统检测
		else if(id=="#ckfushifanghujiance")
    	{
    		return "fshfhjcRoot";
    	}
    	
		//土壤腐蚀性检测
		else if(id=="#ckturangfushixingjiance")
    	{
    		return "trfshxjcRoot";
    	}
    	//杂散电流检测
    	else if(id=="#ckzasandianliujiance")
    	{
    		return "zsdljcRoot";
    	}
 
  		//防腐层检测点
 		else if(id=="#ckfangfucengjiancedian")
    	{
    		return "ffcjcdRoot";
    	}
    	//防腐层破损点
  		else if(id=="#ckfangfucengposundian")
    	{
    		return "ffcpsdRoot";
    	}
 		//测试桩检测
  		else if(id=="#ckceshizhuangjiance")
    	{
    		return "cshzhjcRoot";
    	}
    	//阴极保护密间隔
    	else if(id=="#ckyinjibaohumijiangejiancedian")
    	{
    		return "yjbhmjgjcdRoot";
    	}	
    	else
    	{
    		var rootname=id.substring(3,id.length)+"Root";
    		//alert(rootname);
    		return rootname;
    	}
    }
    //勾选特征点等菜单响应函数
    function refreshByTypeGxChecked(isChecked,id){ 	
    	var zTree = $.fn.zTree.getZTreeObj("treeDemo");
    	var pipelinenos=document.getElementById("gxchecked").value;
    	pipelinenos=pipelinenos.substring(0,pipelinenos.length-1);
    	var pipelinearr=pipelinenos.split(",");
    	var num=pipelinearr.length;
    	var g_typearr=g_type.split(",");
    	var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getTypeNodes.action";  
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      data:{"nodetypes":document.getElementById("nodetypes").value,
		      "gxchecked":document.getElementById("gxchecked").value,
		      "g_type":g_type},  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      		//修改管线根节点ID
		      		var rootgx=zTree.getNodeByParam('id','guanxianroot',null);
		      		if(rootgx==null)
		      		{
		      			rootgx=zTree.getNodeByParam('id','guanxianrootR',null);
		      		}
		      		else
		      		{
		      			rootgx.id="guanxianrootR";
			      		zTree.updateNode(rootgx);
		      		}
			      		
			      	var root=zTree.getNodeByParam('id','0',null);
			      	if(root==null)
			      	{
			      		root=zTree.getNodeByParam('id','0R',null);
			      	}
			      	else
			      	{
			      		root.id="0R";
			      		zTree.updateNode(root);
			      	}
			      	
		      		if(isChecked==true) //勾选
		      		{
		      			//去掉其他管线节点
		      			removeUncheckedPipeline(zTree,num,pipelinearr);
		      			//添加所选类型节点
			      		for(var i=0;i<num;i++)
			      		{			      			
			      			var rootNode=zTree.getNodeByParam('id','gx'+pipelinearr[i],null);
							var node=zTree.getNodeByParam('id',g_typearr[0]+'Root'+pipelinearr[i],null);
							if(node!=null)
							{
								zTree.removeNode(node,true);
							}
							else
							{
								node=zTree.getNodeByParam('id',g_typearr[0]+'root'+pipelinearr[i],null);
								if(node!=null)
								{
									zTree.removeNode(node,true);
								}
							}
							zTree.addNodes(rootNode,data[i]);						
			      		}    
			      		//展开选择勾选的类型节点
		      			expendCheckNode(zTree);	
		      		}
		      		else//取消勾选
		      		{
		      			for(var i=0;i<num;i++)
			      		{			      		
			      			var rootname=getNodeRootName(id);			      			
			      			var rootNode=zTree.getNodeByParam('id',rootname+pipelinearr[i],null);			      			   			
			      			//var rootNode=zTree.getNodeByParam('id','tzroot'+pipelinearr[i],null);
			      			var rootParentNode=rootNode.getParentNode();			      			      			
			      			zTree.removeNode(rootNode,true);			     		
			      			var childnum=rootParentNode.children.length;	
			      			if(childnum==0)
			      			{
			      				zTree.removeNode(rootParentNode,true);
			      			}																
			      		}    
		      		}		      		    	
					zTree.refresh();
					//展开节点			
			    	zTree = $.fn.zTree.getZTreeObj("treeDemo");
					var node = zTree.getNodeByParam('id','0',null);
					if (node != null) {
						zTree.expandNode(node, true, false, true);
					}		      	
		    }  
		});	  	
    }
    function refreshByType(){
    	isToExpand=true; //展开节点
    	var settingtype = {
			check: {
		        enable: true
			    },
			data: {
			        simpleData: {
			            enable: true
			        }
			    },
			async: {
				enable: true,
				url:"<%=request.getContextPath() %>/guanxianAction!getGuanxianTreeType.action",
				autoParam:["id"],
				otherParam:{"nodetypes":document.getElementById("nodetypes").value},
				dataFilter: filter,
				dataType : "text",
				type: "get"
			},
			callback: {
				onClick: zTreeOnClick,
				onDblClick: zTreeOnDblClick,
				beforeAsync: beforeAsync,
				onAsyncSuccess: onAsyncSuccess,
				onAsyncError: onAsyncError,
				onCheck: zTreeOnCheck,
				onExpand: zTreeOnExpand
			},
			view: {
				fontCss: getFontCss
			}
		};
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	$.fn.zTree.init($("#treeDemo"), settingtype,zTreeNodes);
		treeObj.refresh();		
    }
    //管件
    function setGuanjianCheck(){
    	$("#cksantong").attr("checked",$("#ckguanjian").attr("checked"));
    	$("#ckwanguan").attr("checked",$("#ckguanjian").attr("checked"));
    	$("#cktaoguan").attr("checked",$("#ckguanjian").attr("checked"));  
    	setPointCheckParent("#ckguanjian","#ckguanjian,#cksantong,#cktaoguan,#ckwanguan","guanjian,pointTee,taoguan,wanguan");
    }
    //三通
    function setSantongCheck(){
    	if($("#cksantong").attr("checked")==false)
    	{
    		$("#ckguanjian").attr("checked",false);
    		document.getElementById("nodetypes").value = ""; 
    	}
    	else 
    	{   
    		document.getElementById("nodetypes").value = "pointTee";	
    		if($("#ckwanguan").attr("checked")==true&&$("#cktaoguan").attr("checked")==true)	    		
    		{
    			$("#ckguanjian").attr("checked",true);
    		}
    	}   	  	
   		setPointCheckParent("#cksantong","#ckguanjian,#cksantong,#cktaoguan,#ckwanguan","guanjian,pointTee,taoguan,wanguan");  
    }
    //套管
    function setTaoguanCheck(){
    	if($("#cktaoguan").attr("checked")==false)
    	{
    		$("#ckguanjian").attr("checked",false);
    		document.getElementById("nodetypes").value = ""; 
    	}
    	else 
    	{   
    		document.getElementById("nodetypes").value = "taoguan";	
    		if($("#cksantong").attr("checked")==true&&$("#ckwanguan").attr("checked")==true&&$("#cktaoguan").attr("checked")==true)
    		{
    			$("#ckguanjian").attr("checked",true);
    		}		   		
    	}   	
   		setPointCheckParent("#cktaoguan","#ckguanjian,#cksantong,#cktaoguan,#ckwanguan","guanjian,pointTee,taoguan,wanguan");  
    }
    //弯管
    function setWanguanCheck(){
    	if($("#ckwanguan").attr("checked")==false)
    	{
    		$("#ckguanjian").attr("checked",false);
    	}
    	else if($("#cksantong").attr("checked")==true&&$("#ckwanguan").attr("checked")==true&&$("#cktaoguan").attr("checked")==true)
    	{   		
    		$("#ckguanjian").attr("checked",true);
    	}   	
   		setPointCheckParent("#ckwanguan","#ckguanjian,#cksantong,#cktaoguan,#ckwanguan","guanjian,pointTee,taoguan,wanguan");  
    }
    //附属设施
    function setFushussCheck(){
    	$("#ckyangji").attr("checked",$("#ckfushuss").attr("checked"));
    	$("#ckceshiz").attr("checked",$("#ckfushuss").attr("checked"));
    	$("#ckpailiuzz").attr("checked",$("#ckfushuss").attr("checked"));
    	setPointCheckParent("#ckfushuss","#ckfushuss,#ckyangji,#ckceshiz,#ckpailiuzz","fushuss,pointAnode,pointPole,pointDrainage");  
    	//setPointCheck("#ckfushuss","fushuss");	
    }
    //阳极
    function setYangjiCheck(){
    	if($("#ckyangji").attr("checked")==false)
    	{
    		$("#ckfushuss").attr("checked",false);
    	}
    	else if($("#ckyangji").attr("checked")==true&&$("#ckceshiz").attr("checked")==true&&$("#ckpailiuzz").attr("checked")==true)
    	{   		
    		$("#ckfushuss").attr("checked",true);
    	}  
    	setPointCheckParent("#ckyangji","#ckfushuss,#ckyangji,#ckceshiz,#ckpailiuzz","fushuss,pointAnode,pointPole,pointDrainage");    	
    }
    //测试桩
    function setCeshizhuangCheck(){
    	if($("#ckceshiz").attr("checked")==false)
    	{
    		$("#ckfushuss").attr("checked",false);
    	}
    	else if($("#ckyangji").attr("checked")==true&&$("#ckceshiz").attr("checked")==true&&$("#ckpailiuzz").attr("checked")==true)
    	{   		
    		$("#ckfushuss").attr("checked",true);
    	}  
    	setPointCheckParent("#ckceshiz","#ckfushuss,#ckyangji,#ckceshiz,#ckpailiuzz","fushuss,pointAnode,pointPole,pointDrainage");    	
    }
    //排流装置
    function setPailiuzhuangzhiCheck(){
    	if($("#ckpailiuzz").attr("checked")==false)
    	{
    		$("#ckfushuss").attr("checked",false);
    	}
    	else if($("#ckyangji").attr("checked")==true&&$("#ckceshiz").attr("checked")==true&&$("#ckpailiuzz").attr("checked")==true)
    	{   		
    		$("#ckfushuss").attr("checked",true);
    	}  
    	setPointCheckParent("#ckpailiuzz","#ckfushuss,#ckyangji,#ckceshiz,#ckpailiuzz","fushuss,pointAnode,pointPole,pointDrainage");    	
    }
    //生产运行
    function setShengchanyunxingCheck(){
    	$("#ckwendubianhua").attr("checked",$("#ckshengchanyunxing").attr("checked"));
    	$("#ckyalibianhua").attr("checked",$("#ckshengchanyunxing").attr("checked"));
    	$("#ckyichang").attr("checked",$("#ckshengchanyunxing").attr("checked"));
    	$("#ckteshuduan").attr("checked",$("#ckshengchanyunxing").attr("checked"));
    	$("#ckweizhangzhanya").attr("checked",$("#ckshengchanyunxing").attr("checked"));
    	//setPointCheck("#ckshengchanyunxing","shchyx");
    	setPointCheckParent("#ckshengchanyunxing","#ckshengchanyunxing,#ckyichang,#ckteshuduan,#ckweizhangzhanya",
    	"shchyx,yichang,teshuduan,wzzy");    	 
    }
    //异常
    function setYichangCheck(){
    	if($("#ckyichang").attr("checked")==false)
    	{
    		$("#ckshengchanyunxing").attr("checked",false);
    	}
    	else if($("#ckyichang").attr("checked")==true&&$("#teshuduan").attr("checked")==true&&$("#wzzy").attr("checked")==true)
    	{   		
    		$("#ckshengchanyunxing").attr("checked",true);
    	}  
    	setPointCheckParent("#ckyichang","#ckshengchanyunxing,#ckyichang,#ckteshuduan,#ckweizhangzhanya",
    	"shchyx,yichang,teshuduan,wzzy");
    }
    //特殊段
    function setTeshuduanCheck(){
    	if($("#ckteshuduan").attr("checked")==false)
    	{
    		$("#ckshengchanyunxing").attr("checked",false);
    	}
    	else if($("#ckyichang").attr("checked")==true&&$("#teshuduan").attr("checked")==true&&$("#wzzy").attr("checked")==true)
    	{   		
    		$("#ckshengchanyunxing").attr("checked",true);
    	}  
    	setPointCheckParent("#ckteshuduan","#ckshengchanyunxing,#ckyichang,#ckteshuduan,#ckweizhangzhanya",
    	"shchyx,yichang,teshuduan,wzzy");
    }
    //违章占压
    function setWeizhangzhanyaCheck(){
   	 	if($("#ckweizhangzhanya").attr("checked")==false)
    	{
    		$("#ckshengchanyunxing").attr("checked",false);
    	}
    	else if($("#ckyichang").attr("checked")==true&&$("#teshuduan").attr("checked")==true&&$("#wzzy").attr("checked")==true)
    	{   		
    		$("#ckshengchanyunxing").attr("checked",true);
    	}  
    	setPointCheckParent("#ckweizhangzhanya","#ckshengchanyunxing,#ckyichang,#ckteshuduan,#ckweizhangzhanya",
    	"shchyx,yichang,teshuduan,wzzy");
    }
    //生产作业
    function setShengchanzuoyeCheck(){
    	$("#ckshengchanzuoyedian").attr("checked",$("#ckshengchanzuoye").attr("checked"));
    	$("#ckdaiqizuoyejixieyuzhi").attr("checked",$("#ckshengchanzuoye").attr("checked"));
    	setPointCheckParent("#ckshengchanzuoye","#ckshengchanzuoye,#ckshengchanzuoyedian,#ckdaiqizuoyejixieyuzhi",
    	"shchzy,shengchanzyd,dqzyjxyzh");
    	//setPointCheck("#ckshengchanzuoye","shchzy");
    }
    //生产作业点
    function setShengchanzuoyedianCheck(){
    	if($("#ckshengchanzuoyedian").attr("checked")==false)
    	{
    		$("#ckshengchanzuoye").attr("checked",false);
    	}
    	else if($("#ckshengchanzuoyedian").attr("checked")==true&&$("#ckdaiqizuoyejixieyuzhi").attr("checked")==true)
    	{   		
    		$("#ckshengchanzuoye").attr("checked",true);
    	}  
    	setPointCheckParent("#ckshengchanzuoyedian","#ckshengchanzuoye,#ckshengchanzuoyedian,#ckdaiqizuoyejixieyuzhi",
    	"shchzy,shengchanzyd,dqzyjxyzh");
    }
    //带气作业机械预制件
    function setDaiqizuoyejixieyuzhijianCheck(){
    	if($("#ckdaiqizuoyejixieyuzhi").attr("checked")==false)
    	{
    		$("#ckshengchanzuoye").attr("checked",false);
    	}
    	else if($("#ckshengchanzuoyedian").attr("checked")==true&&$("#ckdaiqizuoyejixieyuzhi").attr("checked")==true)
    	{   		
    		$("#ckshengchanzuoye").attr("checked",true);
    	}  
    	setPointCheckParent("#ckdaiqizuoyejixieyuzhi","#ckshengchanzuoye,#ckshengchanzuoyedian,#ckdaiqizuoyejixieyuzhi",
    	"shchzy,shengchanzyd,dqzyjxyzh");
    }
    //事件
    function setShijianCheck(){
    	//alert("shijian");
    	$("#ckshijiandian").attr("checked",$("#ckshijian").attr("checked"));
    	$("#ckxieloudian").attr("checked",$("#ckshijian").attr("checked"));
    	setPointCheckParent("#ckshijian","#ckshijian,#ckshijiandian,#ckxieloudian",
    	"shijian,sjd,xld");
    	//setPointCheck("#ckshijian","shijian");
    }
    //事件点
    function setShijiandianCheck(){
    	if($("#ckshijiandian").attr("checked")==false)
    	{
    		$("#ckshijian").attr("checked",false);
    	}
    	else if($("#ckshijiandian").attr("checked")==true&&$("#ckxieloudian").attr("checked")==true)
    	{   		
    		$("#ckshijian").attr("checked",true);
    	}  
    	setPointCheckParent("#ckshijiandian","#ckshijian,#ckshijiandian,#ckxieloudian",
    	"shijian,sjd,xld");
    }
    //泄漏点
    function setXieloudianCheck(){
   		if($("#ckxieloudian").attr("checked")==false)
    	{
    		$("#ckshijian").attr("checked",false);
    	}
    	else if($("#ckshijiandian").attr("checked")==true&&$("#ckxieloudian").attr("checked")==true)
    	{   		
    		$("#ckshijian").attr("checked",true);
    	}  
    	setPointCheckParent("#ckxieloudian","#ckshijian,#ckshijiandian,#ckxieloudian",
    	"shijian,sjd,xld");	
    }
    //直接检查
    function setZhijiejianchaCheck(){
    	$("#ckwaiguanjiancha").attr("checked",$("#ckzhijiejiancha").attr("checked"));
    	$("#ckbihoujiance").attr("checked",$("#ckzhijiejiancha").attr("checked"));
    	$("#ckfangfucehoudujiance").attr("checked",$("#ckzhijiejiancha").attr("checked"));
    	$("#ckfangfucengposunjiance").attr("checked",$("#ckzhijiejiancha").attr("checked"));
    	$("#ckfushizhuangkuangjiance").attr("checked",$("#ckzhijiejiancha").attr("checked"));
   		$("#ckshexianjiance").attr("checked",$("#ckzhijiejiancha").attr("checked"));
   		setPointCheckParent("#ckzhijiejiancha","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");	
    	//setPointCheck("#ckzhijiejiancha","zhjjch"); 
    }
    //外观检查
    function setWaiguanjianchaCheck(){
   		if($("#ckwaiguanjiancha").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckwaiguanjiancha","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");	
    }
    //壁厚检测
    function setBihoujianceCheck(){
    	if($("#ckbihoujiance").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckbihoujiance","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");
    }
    //防腐层厚度检测
    function setFangfucenghoudujianceCheck(){
   		if($("#ckfangfucehoudujiance").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckfangfucehoudujiance","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");
    }
    //防腐层破损检测
    function setFangfucengposunjianceCheck(){
    	if($("#ckfangfucengposunjiance").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckfangfucengposunjiance","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");
    }
    //腐蚀状况检测
    function setFushizhuangkuangjianceCheck(){
    	if($("#ckfushizhuangkuangjiance").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckfushizhuangkuangjiance","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");
    }
    //射线检测 
    function setShexianjianceCheck(){
    	if($("#ckshexianjiance").attr("checked")==false)
    	{
    		$("#ckzhijiejiancha").attr("checked",false);
    	}
    	else if($("#ckwaiguanjiancha").attr("checked")==true&&
	    	$("#ckbihoujiance").attr("checked")==true&&
	    	$("#ckfangfucehoudujiance").attr("checked")==true&&
	    	$("#ckfangfucengposunjiance").attr("checked")==true&&
	    	$("#ckfushizhuangkuangjiance").attr("checked")==true&&
	    	$("#ckshexianjiance").attr("checked")==true
	    	)
    	{   		
    		$("#ckzhijiejiancha").attr("checked",true);
    	}  
    	setPointCheckParent("#ckshexianjiance","#ckzhijiejiancha,#ckwaiguanjiancha,#ckbihoujiance,#ckfangfucehoudujiance,#ckfangfucengposunjiance,#ckfushizhuangkuangjiance,#ckshexianjiance",
    	"zhjjch,wgjch,bhjc,ffchdjc,ffcpsjc,fshzhkjc,shexianjc");
    }
    //专项检测    
    function setZhuanxiangjianceCheck(){
    	$("#ckdaobojiance").attr("checked",$("#ckzhuanxiangjiance").attr("checked"));
    	$("#ckcijiyijiance").attr("checked",$("#ckzhuanxiangjiance").attr("checked"));
    	$("#ckshunbiandiancijiance").attr("checked",$("#ckzhuanxiangjiance").attr("checked"));
    	setPointCheckParent("#ckzhuanxiangjiance","#ckzhuanxiangjiance,#ckdaobojiance,#ckcijiyijiance,#ckshunbiandiancijiance",
    	"zhxjc,dbjc,cjyjc,shbdcjc");
    }
    //导波检测
    function setDaobojianceCheck(){
    	if($("#ckdaobojiance").attr("checked")==false)
    	{
    		$("#ckzhuanxiangjiance").attr("checked",false);
    	}
    	else if($("#ckdaobojiance").attr("checked")==true&&$("#ckcijiyijiance").attr("checked")==true&&$("#ckshunbiandiancijiance").attr("checked")==true)
    	{   		
    		$("#ckzhuanxiangjiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckdaobojiance","#ckzhuanxiangjiance,#ckdaobojiance,#ckcijiyijiance,#ckshunbiandiancijiance",
    	"zhxjc,dbjc,cjyjc,shbdcjc");
    	//setPointCheck("#ckdaobojiance","dbjc");   
    }
    //磁记忆检测
    function setCijiyijianceCheck(){
    	if($("#ckcijiyijiance").attr("checked")==false)
    	{
    		$("#ckzhuanxiangjiance").attr("checked",false);
    	}
    	else if($("#ckdaobojiance").attr("checked")==true&&$("#ckcijiyijiance").attr("checked")==true&&$("#ckshunbiandiancijiance").attr("checked")==true)
    	{   		
    		$("#ckzhuanxiangjiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckcijiyijiance","#ckzhuanxiangjiance,#ckdaobojiance,#ckcijiyijiance,#ckshunbiandiancijiance",
    	"zhxjc,dbjc,cjyjc,shbdcjc");
    }
    //瞬变电磁检测
     function setShunbiandiancijianceCheck(){
     	if($("#ckshunbiandiancijiance").attr("checked")==false)
    	{
    		$("#ckzhuanxiangjiance").attr("checked",false);
    	}
    	else if($("#ckdaobojiance").attr("checked")==true&&$("#ckcijiyijiance").attr("checked")==true&&$("#ckshunbiandiancijiance").attr("checked")==true)
    	{   		
    		$("#ckzhuanxiangjiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckshunbiandiancijiance","#ckzhuanxiangjiance,#ckdaobojiance,#ckcijiyijiance,#ckshunbiandiancijiance",
    	"zhxjc,dbjc,cjyjc,shbdcjc");
     }
    //理化检测
    function setLihuajianceCheck(){
    	$("#ckyinglishiyan").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#ckhuaxuechengfenfenxi").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#ckyingduceshi").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#ckjinxiangfenxi").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#cklashenshiyan").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#ckwanqushiyan").attr("checked",$("#cklihuajiance").attr("checked"));
    	$("#ckchongjishiyan").attr("checked",$("#cklihuajiance").attr("checked"));
    	setPointCheckParent("#cklihuajiance","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    	//setPointCheck("#cklihuajiance","lhjc"); 
    }
    //应力试验
    function setYinglishiyanCheck(){
    	if($("#ckyinglishiyan").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckyinglishiyan","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    }
    //化学成分分析
    function setHuaxuechengfenfenxiCheck(){
    	if($("#ckhuaxuechengfenfenxi").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckhuaxuechengfenfenxi","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    }
    //硬度测试
    function setYingduceshiCheck(){
    	if($("#ckyingduceshi").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckyingduceshi","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    }
    //金相分析
    function setJinxiangfenxiCheck(){
    	if($("#ckjinxiangfenxi").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckjinxiangfenxi","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    }
    //拉伸试验
    function setLashenshiyanCheck(){
    	if($("#cklashenshiyan").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#cklashenshiyan","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    	//setPointCheck("#cklashenshiyan","lshshy")
    }
    //弯曲试验
    function setWanqushiyanCheck(){
    	if($("#ckwanqushiyan").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckwanqushiyan","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    	//setPointCheck("#ckwanqushiyan","wqshiy")
    }
    //冲击试验 
    function setChongjishiyanCheck(){
    	if($("#ckchongjishiyan").attr("checked")==false)
    	{
    		$("#cklihuajiance").attr("checked",false);
    	}
    	else if($("#ckyinglishiyan").attr("checked")==true
    	&&$("#ckhuaxuechengfenfenxi").attr("checked")==true
    	&&$("#ckyingduceshi").attr("checked")==true
    	&&$("#ckjinxiangfenxi").attr("checked")==true
    	&&$("#cklashenshiyan").attr("checked")==true
    	&&$("#ckwanqushiyan").attr("checked")==true
    	&&$("#ckchongjishiyan").attr("checked")==true)
    	{   		
    		$("#cklihuajiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckchongjishiyan","#cklihuajiance,#ckyinglishiyan,#ckhuaxuechengfenfenxi,#ckyingduceshi,#ckjinxiangfenxi,#cklashenshiyan,#ckwanqushiyan,#ckchongjishiyan",
    	"lhjc,ylshy,hxchffx,ydcsh,jxfx,lshshy,wqshiy,chjshy");
    	//setPointCheck("#ckchongjishiyan","chjshy")
    }
    //泄漏检测
    function setXieloujianceCheck(){
    	$("#ckjiancedian").attr("checked",$("#ckxieloujiance").attr("checked"));
    	$("#ckxieloujiancexieloudian").attr("checked",$("#ckxieloujiance").attr("checked"));
    	setPointCheckParent("#ckxieloujiance","#ckxieloujiance,#ckjiancedian,#ckxieloujiancexieloudian",
    	"xieloujc,xljcjcd,xljcxld");
    	//setPointCheck("#ckxieloujiance","xljc"); 
    }
    //检测点
    function setJiancedianCheck(){
    	if($("#ckjiancedian").attr("checked")==false)
    	{
    		$("#ckxieloujiance").attr("checked",false);
    	}
    	else if($("#ckjiancedian").attr("checked")==true&&$("#ckxieloujiancexieloudian").attr("checked")==true)
    	{   		
    		$("#ckxieloujiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckjiancedian","#ckxieloujiance,#ckjiancedian,#ckxieloujiancexieloudian",
    	"xieloujc,xljcjcd,xljcxld");
    }
    //泄漏检测泄漏点
    function setXieloujianceXieloudianCheck(){
    	if($("#ckxieloujiancexieloudian").attr("checked")==false)
    	{
    		$("#ckxieloujiance").attr("checked",false);
    	}
    	else if($("#ckjiancedian").attr("checked")==true&&$("#ckxieloujiancexieloudian").attr("checked")==true)
    	{   		
    		$("#ckxieloujiance").attr("checked",true);
    	}   	
    	setPointCheckParent("#ckxieloujiancexieloudian","#ckxieloujiance,#ckjiancedian,#ckxieloujiancexieloudian",
    	"xieloujc,xljcjcd,xljcxld");
    	//setPointCheck("#ckxieloujiancexieloudian","xljcxld")
    }
    //腐蚀防护检测
    function setFushifanghujianceCheck(){
    	$("#ckturangfushixingjiance").attr("checked",$("#ckfushifanghujiance").attr("checked"));
    	$("#ckzasandianliujiance").attr("checked",$("#ckfushifanghujiance").attr("checked"));
  		//$("#ckfangfucengjueyuandianzu").attr("checked",$("#ckfushifanghujiance").attr("checked"));
  		$("#ckfangfucengjiancedian").attr("checked",$("#ckfushifanghujiance").attr("checked"));
  		$("#ckfangfucengposundian").attr("checked",$("#ckfushifanghujiance").attr("checked"));
  		$("#ckceshizhuangjiance").attr("checked",$("#ckfushifanghujiance").attr("checked"));
  		//$("#ckyinjibaohuxiaoguojiance").attr("checked",$("#ckfushifanghujiance").attr("checked"));
    	$("#ckyinjibaohumijiangejiancedian").attr("checked",$("#ckfushifanghujiance").attr("checked"));
   		setPointCheckParent("#ckfushifanghujiance",
   		"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",
   		"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
   		//setPointCheck("#ckfushifanghujiance","fshfhjc"); 
    }
    //土壤腐蚀性检测
    function setTurangfushixingjianceCheck(){
    	if($("#ckturangfushixingjiance").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckturangfushixingjiance",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",   		
    	//"fshfhjc,trfshxjc,zsdljc,ffcpsd,cshzhjc,yjbhxgjc,yjbhmjgjcd");
    	  "fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
    }
    //杂散电流检测
    function setZasandianliujianceCheck(){
    	if($("#ckzasandianliujiance").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckzasandianliujiance",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",   		
    	//"fshfhjc,trfshxjc,zsdljc,ffcpsd,cshzhjc,yjbhxgjc,yjbhmjgjcd");
    	  "fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
    }
    //防腐层绝缘电阻
    function setFangfucengjueyuandianzuCheck(){
    	if($("#ckfangfucengjueyuandianzu").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckfangfucengjueyuandianzu","#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"fshfhjc,trfshxjc,zsdljc,ffcpsd,cshzhjc,yjbhxgjc,yjbhmjgjcd");
    }
    //防腐层检测点
    function setFangfucengjiancedianCheck(){
    	if($("#ckfangfucengjiancedian").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckfangfucengjiancedian",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",   
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",   		
    	"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
    }
    
   
    //防腐层破损点
    function setFangfucengposundianCheck(){
    	if($("#ckfangfucengposundian").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckfangfucengposundian",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",  		
    	"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
    	//setPointCheck("#ckfangfucengposundian","ffcpsd")
    }
    //测试桩检测
    function setCeshizhuangjianceCheck(){
    	if($("#ckceshizhuangjiance").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckceshizhuangjiance",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",  		
    	"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");
   		// setPointCheck("#ckceshizhuangjiance","cshzhjc")
    }
    //阴极保护效果检测
    function setYinjibaohuxiaoguojianceCheck(){
    	if($("#ckyinjibaohuxiaoguojiance").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}   
    	setPointCheckParent("#ckyinjibaohuxiaoguojiance",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",  		
    	"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd");   	
   		//setPointCheck("#ckyinjibaohuxiaoguojiance","yjbhxgjc")
    }
    //阴极保护密间隔检测点
    function setYinjibaohumijiancejiancedianCheck(){
    	if($("#ckyinjibaohumijiangejiancedian").attr("checked")==false)
    	{
    		$("#ckfushifanghujiance").attr("checked",false);
    	}
    	else if($("#ckturangfushixingjiance").attr("checked")==true&&
    	$("#ckzasandianliujiance").attr("checked")==true&&    
    	$("#ckfangfucengjiancedian").attr("checked")==true&&
    	$("#ckfangfucengposundian").attr("checked")==true&&
    	$("#ckceshizhuangjiance").attr("checked")==true&&
    	$("#ckyinjibaohumijiangejiancedian").attr("checked")==true)
    	{   		
    		$("#ckfushifanghujiance").attr("checked",true);
    	}  
    	setPointCheckParent("#ckyinjibaohumijiangejiancedian",
    	//"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohuxiaoguojiance,#ckyinjibaohumijiangejiancedian",
    	"#ckfushifanghujiance,#ckturangfushixingjiance,#ckzasandianliujiance,#ckfangfucengjiancedian,#ckfangfucengposundian,#ckceshizhuangjiance,#ckyinjibaohumijiangejiancedian",  		
    	"fshfhjc,trfshxjc,zsdljc,ffcjcd,ffcpsd,cshzhjc,yjbhmjgjcd"); 
  	  	//setPointCheck("#ckyinjibaohumijiangejiancedian","yjbhmjgjcd")
  	 }
  	 
  	 function setDitubj(){
  	 	if($("#ckditubj").attr("checked")==true)
    	{   
    		//var mapStyle={  style : "dark" }  
    		var mapStyle={  style : "grayscale" } 
    		document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);		
    	} 
    	else{
    		var mapStyle={  style : "mapbox" }  
    		document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);		
    	}
  	 }
  	 function setDitubjNormal(){
  	 	var mapStyle={  style : "normal" } 
    	document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);		
  	 }
  	 function setDitubjGrayscale(){
  	 	var mapStyle={  style : "grayscale" } 
    	document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);
  	 }
  	 function setDitubjDark(){
  	 	var mapStyle={  style : "dark" } 
    	document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);
  	 }
  	 function setDitubjLight(){
  	 	var mapStyle={  style : "light" } 
    	document.getElementById("mapcontent").contentWindow.setMapStyle(mapStyle);
  	 }	 
    //统计部分
    function jingtaisj(type){
    	if (type==''){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongji/jingtaisj.jsp");
    	}
    	else if(type=='yalijz'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongji/jingtaisjyalijz.jsp");
    	}
    	else if(type=='yunxingdw'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongji/jingtaisjyunxingdw.jsp");
    	}
    	else if(type=='tezhengd'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongjiAction!initTezhengd.action");
    	}
    	else if(type=='lishisj'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongjiAction!initLishisj.action");
    	}
    	else if(type=='dongtaisj'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongji/dongtaisj.jsp");
    	}
    	else if(type=='createdanxiant'){
    		$("#mapcontent").attr("src","<%=request.getContextPath() %>/tongji/createdanxiant.jsp");
    	}
    }
    
    function zTreeDrawAll()
    {
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
        var nodes = treeObj.transformToArray(treeObj.getNodes());
		for(var i=0;i<nodes.length;i++)
		{
			var node=nodes[i];			
			var treeid = node.id;
			var isParent=node.isParent;
			if(treeid!=0&&isParent!=true)
			{
				zTreeDraw(treeid); 
			}      		
		}  
    }
    
    //在地图上展示
    function zTreeDraw(treeid) {
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
		var treeNode = treeObj.getNodeByParam("id", treeid, null);	   
	    if (treeid=='guanxianroot'||treeid=='0'){
	    	if (treeNode.checked){
	    		drawThumbGuanxian();
	    	}
	    	else{
	    		document.getElementById("mapcontent").contentWindow.removeThumbGuanduanAll();
	    		showOnMap(treeNode);
	    	}
	    }
	    //自定义表单中地图按钮响应
	    else if (treeid.indexOf('auto')==0){
	    	zTreeOnCheckAuto(treeNode);	
	    }
	    //展示管段
	    else if (treeid.indexOf('gdroot')==0){
	    	zTreeOnCheckgdroot(treeid,treeNode);
    	}
    	//在地图上展示节点
    	showOnMap(treeNode);
    	//展示列表
		showTablelist(treeNode);	
	}
   /* function zTreeDraw(treeid) {
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
		var treeNode = treeObj.getNodeByParam("id", treeid, null);	   
	    if (treeid=='guanxianroot'||treeid=='0'){
	    	if (treeNode.checked){
	    		drawThumbGuanxian();
	    	}
	    	else{
	    		document.getElementById("mapcontent").contentWindow.removeThumbGuanduanAll();
	    	}
	    }
	    else if (treeid.indexOf('auto')==0){
	    	
	    	if (treeNode.autotype=='leaf'){
	    		if (treeNode.checked){
	    			var obj = new Object();
	    			obj.marktype = treeNode.marktype;
	    			obj.bjingdu = treeNode.bjingdu;
	    			obj.bweidu = treeNode.bweidu;
	    			obj.ejingdu = treeNode.ejingdu;
	    			obj.eweidu = treeNode.eweidu;
	    			document.getElementById("mapcontent").contentWindow.drawAutoMarker(obj,treeNode.name,treeNode.id);
	    		}
	    		else{
	    			document.getElementById("mapcontent").contentWindow.removeAutoMarker(treeNode.id);
	    		}
	    	}
	    	else{
	    		var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
	    		var nodes = treeObj.getNodesByParam("pId", treeid, null);
	    		for(var i=0;i<nodes.length;i++){
	    			if (treeNode.checked){
	    				var curnode = nodes[i];
	    				var obj = new Object();
		    			obj.marktype = curnode.marktype;
		    			obj.bjingdu = curnode.bjingdu;
		    			obj.bweidu = curnode.bweidu;
		    			obj.ejingdu = curnode.ejingdu;
		    			obj.eweidu = curnode.eweidu;
		    			if (i==0){
		    				document.getElementById("mapcontent").contentWindow.drawAutoMarker(obj,curnode.name,curnode.id);
		    			}
		    			else{
		    				document.getElementById("mapcontent").contentWindow.drawAutoMarkerNoPanto(obj,curnode.name,curnode.id);
		    			}
	    			}
	    			else{
	    				var curnode = nodes[i];
	    				document.getElementById("mapcontent").contentWindow.removeAutoMarker(curnode.id);
	    			}
	    		}
	    	}
	    }
	    else{
	    	if (treeid.indexOf('gdroot')==0)
	    	{
		    	var colorfield = "";
		    	var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanduanlistbyguanxianid.action?treeid="+treeid+"&colorfield="+colorfield; 
	    		$.ajax({  
					  url : actionUrl,  
				      type : "post",  
				      dataType : "json",  
				      cache : false,  
				      error : function(textStatus, errorThrown) {  
				          alert("系统ajax交互错误: " + textStatus.value);  
				      },  
				      success : function(data, textStatus) {
				      	if (treeNode.checked){
	    					document.getElementById("mapcontent").contentWindow.showGuanduanlines(data);
	    					nodes+=treeNode.id+","
	   						document.getElementById("checknodes").value = nodes;
	   					}
				      	else{
				      		document.getElementById("mapcontent").contentWindow.removeGuanduanlines(data);
				      		nodes = nodes.replace(treeNode.id+",","");
	   						document.getElementById("checknodes").value = nodes;
				      	}
				    }  
				});
	    	}
    	}
    	///
    		var id=treeNode.id;
    		if (treeNode.checked)
			{
				document.getElementById("mapcontent").contentWindow.showAddress(id);
			}
			else
			{		
				document.getElementById("mapcontent").contentWindow.removeAutoMarker(id);				      		
			}	
		    
		    if (id.indexOf('tz')>=0){
				//显示特征点列表
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/tezhenglist.jsp?tzid="+id.replace("tz","");
				$("#tableframe").slideDown();
			}
			
			//显示三通列表
			if (id.indexOf('pointTee')>=0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointTeeList.jsp?tzid="+id.replace("pointTee","");
				$("#tableframe").slideDown();
			}
			//显示测试桩列表
			if (id.indexOf('pointPole')>=0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointPoleList.jsp?tzid="+id.replace("pointPole","");
				$("#tableframe").slideDown();
			}
			//显示违章占压列表
			if (id.indexOf('wzzy')>=0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/weizhangzhanyaList.jsp?tzid="+id.replace("wzzy","");
				$("#tableframe").slideDown();
			}
			//显示导波检测列表
			if (id.indexOf('dbjc')>=0){
				document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/daobojianceList.jsp?tzid="+id.replace("dbjc","");
				$("#tableframe").slideDown();
			}
	};
	*/
	function zTreeOnCheckAuto(treeNode){
    	if (treeNode.autotype=='leaf'){
    		if (treeNode.checked){
    			var obj = new Object();
    			obj.marktype = treeNode.marktype;
    			obj.bjingdu = treeNode.bjingdu;
    			obj.bweidu = treeNode.bweidu;
    			obj.ejingdu = treeNode.ejingdu;
    			obj.eweidu = treeNode.eweidu;
    			document.getElementById("mapcontent").contentWindow.drawAutoMarker(obj,treeNode.name,treeNode.id);
    		}
    		else{
    			document.getElementById("mapcontent").contentWindow.removeAutoMarker(treeNode.id);
    		}
    	}
    	else{
    		var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    		var treeid=treeNode.id;
    		var nodes = treeObj.getNodesByParam("pId", treeid, null);
    		for(var i=0;i<nodes.length;i++){
    			if (treeNode.checked){
    				var curnode = nodes[i];
    				var obj = new Object();
	    			obj.marktype = curnode.marktype;
	    			obj.bjingdu = curnode.bjingdu;
	    			obj.bweidu = curnode.bweidu;
	    			obj.ejingdu = curnode.ejingdu;
	    			obj.eweidu = curnode.eweidu;
	    			if (i==0){
	    				document.getElementById("mapcontent").contentWindow.drawAutoMarker(obj,curnode.name,curnode.id);
	    			}
	    			else{
	    				document.getElementById("mapcontent").contentWindow.drawAutoMarkerNoPanto(obj,curnode.name,curnode.id);
	    			}
    			}
    			else{
    				var curnode = nodes[i];
    				document.getElementById("mapcontent").contentWindow.removeAutoMarker(curnode.id);
    			}
    		}
    	}	
	}
    function zTreeOnCheckgdroot(treeid,treeNode,nodes) {  	
    	var colorfield = "";
    	var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getGuanduanlistbyguanxianid.action?treeid="+treeid+"&colorfield="+colorfield; 
   		$.ajax({  
			  url : actionUrl,  
		      type : "post",  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if (treeNode.checked){
   					document.getElementById("mapcontent").contentWindow.showGuanduanlines(data);
   					nodes+=treeNode.id+","
  						document.getElementById("checknodes").value = nodes;
  					}
		      	else{
		      		document.getElementById("mapcontent").contentWindow.removeGuanduanlines(data);
		      		if(nodes!=null)
		      		{
		      			nodes = nodes.replace(treeNode.id+",","");
  						document.getElementById("checknodes").value = nodes;
		      		}
		      		
		      	}
		    }  
		});	    	
    }
    //展示特征点、三通等列表
    function showTablelist(treeNode){
    	var id=treeNode.id;	
     	if (id.indexOf('tz')>=0){
			//显示特征点列表
			document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/tezhenglist.jsp?tzid="+id.replace("tz","");
			$("#tableframe").slideDown();
		}
		//
		//显示三通列表
		if (id.indexOf('pointTee')>=0){
			document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointTeeList.jsp?tzid="+id.replace("pointTee","");
			$("#tableframe").slideDown();
		}
		//显示测试桩列表
		if (id.indexOf('pointPole')>=0){
			document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/pointPoleList.jsp?tzid="+id.replace("pointPole","");
			$("#tableframe").slideDown();
		}
		//显示违章占压列表
		if (id.indexOf('wzzy')>=0){
			document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/weizhangzhanyaList.jsp?tzid="+id.replace("wzzy","");
			$("#tableframe").slideDown();
		}
		//显示导波检测列表
		if (id.indexOf('dbjc')>=0){
			document.getElementById("tableframe").src = "<%=request.getContextPath() %>/map/daobojianceList.jsp?tzid="+id.replace("dbjc","");
			$("#tableframe").slideDown();
		}
    }
    /*
     function showOnMap(treeNode) {
    	var id=treeNode.id;
    	//管线
		if (id.indexOf('gx')==0){		
			var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
			var nodes = treeObj.getNodesByParam("pId", id, null);			
			var node=nodes[0];
			var nodeid=nodes[0].id;
			if(node.isParent==true)
			{
				var nodes = treeObj.getNodesByParam("pId", nodeid, null);
				var guanduannum=nodes.length;
				//if(guanduannum==0)//避免画两次
				{
					zTreeOnCheckgdroot(nodeid,node);
				}
			}			
		}
		else
		{
			if (treeNode.checked) //勾选
			{	
				if(treeNode.isParent==false)	//叶子节点			
				{
					document.getElementById("mapcontent").contentWindow.showAddress(id);
				}
				else //各种父节点
				{
					var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
					var nodes = treeObj.getNodesByParam("pId", id, null);					
					for(var i=0;i<nodes.length;i++)
					{						
						showOnMap(nodes[i]);
					}
				}
			}
			else //取消勾选
			{	
				if(treeNode.isParent==false)	//叶子节点		
				{					
					document.getElementById("mapcontent").contentWindow.removeAutoMarker(id);
				}
				else //各种父节点
				{
					
					document.getElementById("mapcontent").contentWindow.removeAutoMarker(id);		
					var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
					var nodes = treeObj.getNodesByParam("pId", id, null);
					for(var i=0;i<nodes.length;i++)
					{						
						showOnMap(nodes[i]);
					}
				}				      		
			}	
		}   	
    }*/
    function showOnMap(treeNode) {
    	var id=treeNode.id;
    	//管线
		if (id.indexOf('gx')==0){		
			var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
			var nodes = treeObj.getNodesByParam("pId", id, null);			
			var node=nodes[0];
			var nodeid=nodes[0].id;
			if(node.isParent==true)
			{
				var nodes = treeObj.getNodesByParam("pId", nodeid, null);
				var guanduannum=nodes.length;
				//if(guanduannum==0)//避免画两次
				{
					zTreeOnCheckgdroot(nodeid,node);
				}
			}			
			//
			//获取选中节点
			var nodesAll = treeObj.transformToArray(treeObj.getNodes());
			for(var i=0;i<nodesAll.length;i++)
			{
				var node=nodesAll[i];			
				var treeid = node.id;
				var isParent=node.isParent;
				if(treeid!=0&&isParent!=true)
				{
					zTreeDraw(treeid); 
				}      		
			} 		
		}
		else
		{
			if (treeNode.checked) //勾选
			{	
				//if(treeNode.isParent==false&&id.indexOf('gd')==-1)	//叶子节点			
				//if(id.indexOf('Root')<0&&id.indexOf('root')<0) //叶子节点
				if(treeNode.isParent==false)	//叶子节点	
				{
					if(id.indexOf('gd')!=-1)  //管段节点
					{
						var node = treeNode.getParentNode();	
						var checked=node.getCheckStatus().half;						
						if(checked==true) //半选
						{						
							document.getElementById("mapcontent").contentWindow.showAddress(id);
						}
					}	
					else
					{
						document.getElementById("mapcontent").contentWindow.showAddress(id);						
					}				
				}
				else //各种父节点
				{
					//document.getElementById("mapcontent").contentWindow.showAddress(id);
					var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
					var nodes = treeObj.getNodesByParam("pId", id, null);					
					for(var i=0;i<nodes.length;i++)
					{						
						showOnMap(nodes[i]);
					}
					//document.getElementById("mapcontent").contentWindow.showAddress(id,nodeids);		
				}
			}
			else //取消勾选
			{	
				if(treeNode.isParent==false)	//叶子节点		
				//if(id.indexOf('Root')<0&&id.indexOf('root')<0) //叶子节点
				{					
					document.getElementById("mapcontent").contentWindow.removeAutoMarker(id);
				}
				else //各种父节点
				{
					
					document.getElementById("mapcontent").contentWindow.removeAutoMarker(id);		
					var treeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
					var nodes = treeObj.getNodesByParam("pId", id, null);
					for(var i=0;i<nodes.length;i++)
					{						
						showOnMap(nodes[i]);
					}
					/*for(var i=0;i<nodes.length;i++)
					{
						nodeids[i]=nodes[i].id;
					}*/		
					//document.getElementById("mapcontent").contentWindow.removeAutoMarkerArray(nodeids);
				}				      		
			}	
		}   	
    }
    //查看checknode
    function zTreeOnCheck(event, treeId, treeNode) {   	
    	var nodes = document.getElementById("checknodes").value;
    	//把管线下所有管段绘制到地图上
	    var treeid = treeNode.id;
	    //if (treeid=='guanxianrootAll'||treeid=='0'){
	    if (treeid=='guanxianroot'||treeid=='0'){
	    	if (treeNode.checked){
	    		drawThumbGuanxian();
	    	}
	    	else{
	    		document.getElementById("mapcontent").contentWindow.removeThumbGuanduanAll();
	    		//showOnMap(treeNode);
	    		document.getElementById("mapcontent").contentWindow.removeGuanduanAll();		
	    		document.getElementById("mapcontent").contentWindow.removeFamenAll();		
	    	}
	    }
	    //自定义表单中地图按钮响应
	    else if (treeid.indexOf('auto')==0){
	    	zTreeOnCheckAuto(treeNode);	
	    }
	    //展示管段
	    else if (treeid.indexOf('gdroot')==0){
	    	if(nodes!=null)
	    	{
	    		zTreeOnCheckgdroot(treeid,treeNode,nodes);
	    	}	
    	}
    	//在地图上展示节点
    	else{
    		showOnMap(treeNode);
    	}
    	//展示列表
    	if (treeNode.checked){
    		showTablelist(treeNode);	
    	}
		else{
			//显示空列表
			document.getElementById("tableframe").src="<%=request.getContextPath() %>/map/mainTableList.jsp";
			$("#tableframe").slideDown();
		}	   
	};
	
	
	function drawAllGuanxuan(guanxianid){
		var colorfield = "";
		if ($("#ckfushifhxtpj").attr("checked")){
			colorfield = "fushifhxtpj";
		}else if($("#ckfengxianpg").attr("checked")){
			colorfield = "fengxianpg";
		}
		var actionUrl = "<%=request.getContextPath() %>/guanxianAction!getDrawGuanduaninfo.action?guanxianid="+guanxianid+"&colorfield="+colorfield;
   		$.ajax({  
			  url : actionUrl,  
		      type : "post",  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if(data.result=="success"){
		      		document.getElementById("mapcontent").contentWindow.showGuanduanlines(data.guanduandata,false);
		      		drawAllGuanxuan(data.guanxianid);
		      	}
		    }  
		});
	}
	
	function drawThumbGuanxian(){
		var actionUrl = "<%=request.getContextPath() %>/guanxianAction!drawThumbGuanxian.action";
   		$.ajax({  
			  url : actionUrl,  
		      type : "post",  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if(data.result=="success"){
		      		document.getElementById("mapcontent").contentWindow.showThumbGuanduanlines(data.guanduandata,false);
		      	}
		    }  
		});
	}
	
	function changeRight(url,menuname){
            //自定义表单添加、修改、查看需要加上菜单名称
            if(url.indexOf("?")>-1){
                url = url +"&menuname="+encodeURIComponent(encodeURIComponent(menuname));
            }else{
                url = url +"?menuname="+encodeURIComponent(encodeURIComponent(menuname));
            }
            jQuery("#mapcontent").attr("src",url);
            window.scrollTo(0,0); 
            document.getElementById("tableframe").style.display = "none";
            $(".contLeft").css("display", "none");
            var docWidth = document.documentElement.clientWidth;
	    	$(".contRgt").css("width", ((docWidth-58) + "px"));
    }
    function mainPage(){
    	document.location.href = "main.jsp";
    }
    function showTree(){ 
    	//document.location.href = "main.jsp";
    	var settingkey = {
					check: {
				        enable: true
					    },
					data: {
					        simpleData: {
					        enable: true
					        }
					    },
					callback: {
						onClick: zTreeOnClick,
						onDblClick: zTreeOnDblClick,
						beforeAsync: beforeAsync,
						onAsyncSuccess: onAsyncSuccess,
						onAsyncError: onAsyncError,
						onCheck: zTreeOnCheck,
						onExpand: zTreeOnExpand
					},
					view: {
						fontCss: getFontCss
					}
				};
    	$(".contLeft").show();
    	var docWidth = document.documentElement.clientWidth;
	    $(".contRgt").css("width", ((docWidth - $(".contLeft").width()-58) + "px"));
	    jQuery("#mapcontent").attr("src","<%=request.getContextPath() %>/map/mainmap.jsp");
     	$.fn.zTree.init($("#treeDemo"), settingkey,zTreeNodes);
     	//$.fn.zTree.init($("#treeDemo"), setting,zTreeNodes);
			key = $("#key");
			key.bind("focus", focusKey)
			.bind("blur", blurKey)
			zTree = $.fn.zTree.getZTreeObj("treeDemo");
			var node = zTree.getNodeByParam('id','0',null);
			if (node != null) {
				zTree.expandNode(node, true, true, true);
			}
		
    }
	function PrintPage()
	{
		document.getElementById("mapcontent").contentWindow.PrintPage();
	}
    function UpdateDBData()
    {
   		var actionUrl = "<%=request.getContextPath() %>/updateDataAction!updateDBData.action";  
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      //data : params,  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if(data.result=='success'){
		      		alert("更新成功！");        
		      	}else{
		      		alert("更新失败！");
		      	}
		    }  
		});
    	
    }
    
    var autoroot;
    function addAutoroot(tablename,tablecnname){
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	 //修改管线根节点ID
   		var rootgx=treeObj.getNodeByParam('id','guanxianroot',null);
   		if(rootgx==null)
   		{
   			rootgx=treeObj.getNodeByParam('id','guanxianrootR',null);
   		}
   		else
   		{
   			rootgx.id="guanxianrootR";
    		zTree.updateNode(rootgx);
   		}
      		
      	var root=treeObj.getNodeByParam('id','0',null);
      	if(root==null)
      	{
      		root=treeObj.getNodeByParam('id','0R',null);
      	}
      	else
      	{
      		root.id="0R";
      		zTree.updateNode(root);
      	}
      	//
    	var parentnode = zTree.getNodeByParam('id','0R',null);
    	treeObj.removeChildNodes(parentnode);
    	var curnode = zTree.getNodeByParam('id',"auto_"+tablename,null);
        if (curnode==null){
        	var newNode = {name:tablecnname,id:"auto_"+tablename,autotype:"root"};
    		autoroot = treeObj.addNodes(parentnode, newNode);
        }
        //更新根节点ID
       
    }
    
    function addAutoleaf(tablename,markid,mapmark,obj){
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var newNode = {name:mapmark,id:'auto_'+tablename+'_'+markid,marktype:obj.marktype,bjingdu:obj.bjingdu,bweidu:obj.bweidu,ejingdu:obj.ejingdu,eweidu:obj.eweidu,autotype:"leaf"};
    	var curnode = zTree.getNodeByParam('id','auto_'+tablename+'_'+markid,null);
        if (curnode==null){
        	var parentnode = zTree.getNodeByParam('id','auto_'+tablename,null);
    		treeObj.addNodes(parentnode, newNode);
        }
    }
    
    
    function kuangxuan(){
    	document.getElementById("mapcontent").contentWindow.kuangxuan();
    }
    
    /*function getTreeSelectgx(){
    	var ids = "";
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var nodes = zTree.getNodesByParam('pId','guanxianroot',null);
    	var nodecount = 0;
    	for(var i=0;i<nodes.length;i++){
    		if (nodes[i].checked){
    			ids += nodes[i].id.replace('gx','')+",";
    			nodecount=nodecount+1;
    		}
    	}
    	if (ids.length>0){
    		ids = ids.substring(0,ids.length-1);
    	}
    	if (nodecount>1000){
    		ids = "all";
    	}
    	return ids;
    }*/
    
     function getTreeSelectgx(){
    	var ids = "";
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var nodes = zTree.transformToArray(zTree.getNodes());
    	//var nodes = zTree.getNodesByParam('pId','guanxianroot',null);
    	var nodecount = 0;
    	for(var i=0;i<nodes.length;i++){
    		if (nodes[i].checked&&nodes[i].id.indexOf("gx")==0){
    			ids += nodes[i].id.replace('gx','')+",";
    			nodecount=nodecount+1;
    		}
    	}
    	if (ids.length>0){
    		ids = ids.substring(0,ids.length-1);
    	}
    	if (nodecount>1000){
    		ids = "all";
    	}
    	//alert(ids);
    	return ids;
    }
    
    function getTreeSelectzx(){
    	var ids = "";
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var nodes = zTree.getNodesByParam('pId','zhanxiangRoot',null);    	
    	//var nodes = zTree.getNodesByParam('pId','zhanxiangroot',null);
    	var nodecount = 0;
    	for(var i=0;i<nodes.length;i++){
    		if (nodes[i].checked){    			
    			//ids += nodes[i].id.replace('zx','')+",";
    			ids += nodes[i].id.replace('zxRoot','')+",";
    			nodecount=nodecount+1;
    		}
    	}
    	if (ids.length>0){
    		ids = ids.substring(0,ids.length-1);
    	}
    	if (nodecount>1000){
    		ids = "all";
    	}
    	//alert(ids);
    	return ids;
    }
    
    function getTreeSelectfm(){
    	var ids = "";
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var nodes = zTree.getNodesByParam('pId','guanxianroot',null);
    	var nodecount = 0;
    	for(var i=0;i<nodes.length;i++){
    		if (nodes[i].checked){
    			var gxid = nodes[i].id.replace('gx','');
    			var subnodes = zTree.getNodesByParam('pId','valveRoot'+gxid,null);
    			if(subnodes==null)
    			{
    				continue;
    			}
    			for(var j=0;j<subnodes.length;j++){
    				if (subnodes[j].checked){
    					//ids += subnodes[i].id.replace('valve','')+",";
    					ids += subnodes[j].id.replace('valve','')+",";
    					nodecount=nodecount+1;
    				}
    			}
    		}
    	}
    	if (ids.length>0){
    		ids = ids.substring(0,ids.length-1);
    	}
    	if (nodecount>1000){
    		ids = "all";
    	}
    	return ids;
    }
    
    function getTreeSelecttzd(){
    	var ids = "";
    	var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
    	var nodes = zTree.getNodesByParam('pId','guanxianroot',null);
    	var nodecount = 0;
    	for(var i=0;i<nodes.length;i++){
    		if (nodes[i].checked){
    			var gxid = nodes[i].id.replace('gx','');
    			var subnodes = zTree.getNodesByParam('pId','tzroot'+gxid,null);
    			for(var j=0;j<subnodes.length;j++){
    				if (subnodes[j].checked){
    					ids += subnodes[i].id.substring(2)+",";
    					nodecount=nodecount+1;
    				}
    			}
    		}
    	}
    	if (ids.length>0){
    		ids = ids.substring(0,ids.length-1);
    	}
    	if (nodecount>1000){
    		ids = "all";
    	}
    	return ids;
    }

 	//风险评估
    function fengxianpinggu(){
    	//$("#mapcontent").attr("src","<%=request.getContextPath() %>/pinggupingjia/fengxianpinggu.jsp");
   		//document.getElementById("tableframe").style.display="inline";
   		var url="<%=request.getContextPath() %>/pinggupingjia/fengxianpinggu.jsp";
   		var height = 600;
		var width = 600;
		var top=Math.round((window.screen.height-height)/2);
		var left=Math.round((window.screen.width-width)/2);
	    window.open(url,"风险评估","width="+width+",height="+height+",top="+top+",left="+left);
   		//window.open(url,'风险评估','modal=yes,width=560,height=600,resizable=no,scrollbars=no'); 
    }
    
    function fengxianpgclick(){
    	document.getElementById("mapcontent").contentWindow.showGuanduanlinescolor("1");
    }
    
    function anquanzkdjclick(){   	
    	document.getElementById("mapcontent").contentWindow.showGuanduanlinescolor("2");
    }
    function coatingrisoclick(){   	
    	document.getElementById("mapcontent").contentWindow.showGuanduanlinescolorRiso();
    }
    function cpevaluateclick(){   	
    	document.getElementById("mapcontent").contentWindow.showGuanduanlinescolorCp();
    }
    
    function importGuanduan(){
	   	var height = 400;
		var width = 600;
		var top=Math.round((window.screen.height-height)/2);
		var left=Math.round((window.screen.width-width)/2);
	    window.open("<%=request.getContextPath() %>/view/file_importguanduan.jsp","","width="+width+",height="+height+",top="+top+",left="+left);
    }
    function showweizhixinxi(){
    	if($("#ckweizhixinxi").attr("checked"))
    	{
			document.getElementById("mapcontent").contentWindow.addlistener();
    	}
    	else
    	{
    		document.getElementById("mapcontent").contentWindow.removelistener();
    	}
    }
    

</script>

</head>
    

<body>
	<div class="head">   
		<div class="head_main clearfix">
			<div class="logo">燃气管道数据信息分析评价系统</div>
            <div class="head_menu clearfix">
              <i></i>
              <!-- <a href="#" onclick='showTree()'><span class="home">主页</span></a>  -->
              <a href="#" onclick='mainPage()'><span class="home">主页</span></a>             
              <i></i>
              <a href="#"><span class="exit" onclick="logout()">退出</span></a>
            </div>
        </div>
	</div>
    
    <div class="navigation suckerdiv">
      <ul class="clearfix" id="suckertree1">
        <li class='bar1'>
        <a href="#">系统管理</a>
          <ul>
            <div class="nav_nav"></div>
            <li><a href="#">静态数据</a>
            		<ul>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4801&temp=3871&_=1461829902546")'>A工程项目信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5041&temp=3871&_=1461829902546")'>B管线信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4861&temp=3871&_=1461829902546")'>C管段信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4821&temp=3871&_=1461829902546")'>C-1特征点信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4822&temp=3871&_=1461829902546")'>C-2三通信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4823&temp=3871&_=1461829902546")'>C-3阳极信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4824&temp=3871&_=1461829902546")'>C-4测试桩信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4825&temp=3871&_=1461829902546")'>C-5排流装置信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4826&temp=3871&_=1461829902546")'>C-6穿跨越信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4827&temp=3871&_=1461829902546")'>C-7套管信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4828&temp=3871&_=1461829902546")'>C-8弯管信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4829&temp=3871&_=1461829902546")'>C-9内衬信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4830&temp=3871&_=1461829902546")'>D阀门信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4832&temp=3871&_=1461829902546")'>E站箱信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4835&temp=3871&_=1461829902546")'>E-1过滤器信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4836&temp=3871&_=1461829902546")'>E-2安全阀信息</a></li>
            		</ul>
            	</li>
            	<li><a href="#">运行数据</a>
            		<ul>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4841&temp=3871&_=1461829902546")'>F-1异常信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5145&temp=3871&_=1461829902546")'>F-2特殊段信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4843&temp=3871&_=1461829902546")'>F-3违章占压信息</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5201&temp=3871&_=1461829902546")'>G应急事件点</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4845&temp=3871&_=1461829902546")'>G-1泄漏点</a></li>           		
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5202&temp=3871&_=1461829902546")'>H生产作业点</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4847&temp=3871&_=1461829902546")'>H-1带气作业机械预制件</a></li>
            		</ul>
            	</li>
            	<li><a href="#">动态数据</a>
            		<ul>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4848&temp=3871&_=1461829902546")'>1检验检测任务</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4849&temp=3871&_=1461829902546")'>2检验汇总</a></li>
            			<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4850&temp=3871&_=1461829902546")'>3资料审查</a></li>
            			<li><a href="#" >宏观检查</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4851&temp=3871&_=1461829902546")'>4宏观检查</a>/li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4901&temp=3871&_=1461829902546")'>4-1特征点检测</a>/li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4902&temp=3871&_=1461829902546")'>4-2穿越检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4903&temp=3871&_=1461829902546")'>4-3泄漏检测</a></li>    
            				</ul>
            			</li>
            			<li><a href="#">腐蚀防护系统检测</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4904&temp=3871&_=1461829902546")'>5-1土壤腐蚀性检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5261&temp=3871&_=1461829902546")'>5-2杂散电流检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4881&temp=3871&_=1461829902546")'>5-3绝缘电阻检测PCM</a></li>     				          					
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4963&temp=3871&_=1461829902546")'>5-4绝缘电阻检测C扫描</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5021&temp=3871&_=1461829902546")'>5-5绝缘电阻检测PEARSON</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4905&temp=3871&_=1461829902546")'>5-6防腐层破损点</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4906&temp=3871&_=1461829902546")'>5-7防腐层绝缘电阻评估</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4907&temp=3871&_=1461829902546")'>5-8测试桩检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4985&temp=3871&_=1461829902546")'>5-9阴极保护CIPS检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5189&temp=3871&_=1461829902546")'>5-10阴极保护效果评估</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4909&temp=3871&_=1461829902546")'>5-11-1直流干扰防护系统检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4919&temp=3871&_=1461829902546")'>5-11-2交流干扰防护系统检测</a></li>
            					<li><a href="#"onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4910&temp=3871&_=1461829902546")'>5-12腐蚀防护系统评价</a></li>
            				</ul>
            			</li>
            			<li><a href="#">直接检测</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4911&temp=3871&_=1461829902546")'>6-1外观检查</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4987&temp=3871&_=1461829902546")'>6-2壁厚检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4989&temp=3871&_=1461829902546")'>6-3防腐层厚度检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4913&temp=3871&_=1461829902546")'>6-4防腐层破损检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4914&temp=3871&_=1461829902546")'>6-5腐蚀状况检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4991&temp=3871&_=1461829902546")'>6-6射线检测</a></li>
            				</ul>
            			</li>
            				
            			<li><a href="#">理化检测</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4993&temp=3871&_=1461829902546")'>7-1化学成分分析</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5001&temp=3871&_=1461829902546")'>7-2硬度测试</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5003&temp=3871&_=1461829902546")'>7-3金相分析</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4995&temp=3871&_=1461829902546")'>7-4拉伸试验</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=5004&temp=3871&_=1461829902546")'>7-5弯曲试验</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4997&temp=3871&_=1461829902546")'>7-6冲击试验</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4999&temp=3871&_=1461829902546")'>7-7残余应力测试</a></li>
            				</ul>
            			</li>
            			<li><a href="#">专项检测</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4915&temp=3871&_=1461829902546")'>8-1导波检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4916&temp=3871&_=1461829902546")'>8-2磁记忆应力检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4917&temp=3871&_=1461829902546")'>8-3瞬变电磁检测</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4921&temp=3871&_=1461829902546")'>8-4安全阀校验</a></li>
            				</ul>
            			</li>
            			<li><a href="#">评估评价</a>
            				<ul>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4918&temp=3871&_=1461829902546")'>9-1安全状况评估</a></li>
            					<li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4922&temp=3871&_=1461829902546")'>9-2合于使用评价报告</a></li>
            				</ul>
            			</li>
            		</ul>
            	</li>

           	<%out.println(ShowTree.createXpMenu(request)); %>
            <!-- <li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/system/menuIndex.jsp")'>菜单管理</a></li>
            <li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/system/usersIndex.jsp")'>用户管理</a></li>
            <li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/system/organizationIndex.jsp")'>组织管理</a></li>
            <li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/system/rolesIndex.jsp")'>角色管理</a></li>
            <li><a href="#" onclick='changeRight("<%=request.getContextPath() %>/system/updatePwd.jsp")'>修改密码</a></li>  -->
			<li><a href="#" onclick='PrintPage()'>打印</a></li>
			<!-- <li><a href="#" onclick='UpdateDBData()'>更新数据</a></li> -->
			<!-- <li><a href="#" onclick='ViewLog()'>查看日志</a></li>-->
          </ul>
        </li>
        <li class='bar1'><a href="#">选取查询</a>
          <ul>
            <div class="nav_nav"></div>
            <li><a href="#" onclick='kuangxuan()'>框选</a></li>
            <li><a href="#" onclick='showzuobiaodw()'>坐标定位</a></li>
            <li><a href="#">最短路径</a></li>
             <!--<li><a href="#" onclick='guanduancx()'>管线查询</a></li> --> 
            <li><a href="#" onclick='pipeLineSearch()'>管线查询</a></li> 
            <li><a href="#" onclick='pipeSectionSearch()'>管段查询</a></li>
            <li><a href="#" onclick='pipePointSearch()'>特征点查询</a>
             <!--   <ul>
                <li><a href="#" onclick='pipePointSearch()'>特征点</a></li>
                <li><a href="#">三通</a></li>
                <li><a href="#">阳极</a></li>
                <li><a href="#">测试桩</a></li>
                <li><a href="#">排流装置</a></li>
                <li><a href="#">穿跨越</a></li>
                <li><a href="#">弯管</a></li>
                <li><a href="#">套管</a></li>
                <li><a href="#">内衬</a></li>
                <li><a href="#">阀门</a></li>
                <li><a href="#">异常</a></li>
                <li><a href="#">特殊段</a></li>
                <li><a href="#">违章占压</a></li>
                <li><a href="#">泄漏点</a></li>
                <li><a href="#">带气/作业机械预制</a></li>
                <li><a href="#">生产作业</a></li>
              </ul>
             -->
            </li>
            <li><a href="#"  onclick='testTaskSearch()'>任务查询</a></li>
            <!--  <li><a href="#">高级查询</a></li> -->
			<li><a href="#">到检提醒</a>
			<ul>			
                <li><a href="#" onclick='refreshtreebyJijiangdaoqi()'>即将到期</a></li>
                <li><a href="#" onclick='refreshtreebyChaoqi()'>超期</a></li>
              </ul>
			</li>
          </ul>
        </li>
  		<li class='bar1'><a href="#">基本信息</a>
         	 <ul>
          	  <div class="nav_nav"></div>   			 
  				 <li><input type="checkbox" id='cktezhengd' class='menuchk menu_sel'  /><a href="#">特征点</a></li>	
  			 	 <li><input type="checkbox" id='ckguanjian' class='menuchk menu_sel'  /><a href="#">管件</a>
              		<ul>                       
                	<li><input type="checkbox" id='cksantong' class='menuchk menu_sel'  /><a href="#">三通</a></li>               
                	<li><input type="checkbox" id='cktaoguan' class='menuchk menu_sel'  /><a href="#">套管</a></li>
               		<li><input type="checkbox" id='ckwanguan' class='menuchk menu_sel'  /><a href="#">弯管</a></li>				
             		</ul>
            	</li>
            	<!--<li><input type="checkbox" id='ckchuankuay' class='menuchk menu_sel'  /><a href="#">阀门</a></li>    -->            	         
           		<li><input type="checkbox" id='ckchuankuay' class='menuchk menu_sel'  /><a href="#">穿跨越</a></li>
            	<li><input type="checkbox" id='ckneichen' class='menuchk menu_sel'  /><a href="#">内衬</a></li>               	
				<li><input type="checkbox" id='ckfushuss' class='menuchk menu_sel'  /><a href="#">附属设施</a>
              		<ul>              
					<li><input type="checkbox" id='ckyangji' class='menuchk menu_sel'  /><a href="#">阳极</a></li>
               		<li><input type="checkbox" id='ckceshiz' class='menuchk menu_sel'  /><a href="#">测试桩</a></li>
                	<li><input type="checkbox" id='ckpailiuzz' class='menuchk menu_sel'  /><a href="#">排流装置</a></li>
              		</ul>
            	</li>
			 </ul>
		</li>  
        <li class='bar1'><a href="#">运行数据</a>
          <ul>
            <div class="nav_nav"></div>
            <li><input type="checkbox" id='ckshengchanyunxing' class='menuchk menu_sel'  /><a href="#">生产运行</a>
              <ul>
                <li><input type="checkbox" id='ckwendubianhua' class='menuchk menu_sel'  /><a href="#">温度变化</a></li>
                <li><input type="checkbox" id='ckyalibianhua' class='menuchk menu_sel'  /><a href="#">压力变化</a></li>
                <li><input type="checkbox" id='ckyichang' class='menuchk menu_sel'  /><a href="#">异常</a></li>
                <li><input type="checkbox" id='ckteshuduan' class='menuchk menu_sel'  /><a href="#">特殊段</a></li>
                <li><input type="checkbox" id='ckweizhangzhanya' class='menuchk menu_sel'  /><a href="#">违章占压</a></li>
              </ul>
            </li>
			 <li><input type="checkbox" id='ckshengchanzuoye' class='menuchk menu_sel'  /><a href="#">生产作业</a>
              <ul>
                <li><input type="checkbox" id='ckshengchanzuoyedian' class='menuchk menu_sel'  /><a href="#">生产作业点</a></li>
                <li><input type="checkbox" id='ckdaiqizuoyejixieyuzhi' class='menuchk menu_sel'  /><a href="#">带气作业机械预制</a></li>
              </ul>
            </li>
			<li><input type="checkbox" id='ckshijian' class='menuchk menu_sel'  /><a href="#">事件</a>
              <ul>
                <li><input type="checkbox" id='ckshijiandian' class='menuchk menu_sel'  /><a href="#">事件点</a></li>
                <li><input type="checkbox" id='ckxieloudian' class='menuchk menu_sel'  /><a href="#">泄漏点</a></li>
              </ul>
            </li>
          </ul>
        </li>

        


        <li class='bar1'><a href="#">检测数据</a>
          <ul>
            <div class="nav_nav"></div>           
            <li><input type="checkbox" id='cktezhengdianjiancha' class='menuchk menu_sel'  /><a href="#">特征点检查</a></li>
            <li><input type="checkbox" id='ckchuanyuejiancha' class='menuchk menu_sel'  /><a href="#">穿越检查</a></li>
            <li><input type="checkbox" id='ckzhijiejiancha' class='menuchk menu_sel'  /><a href="#">直接检查</a>
            	<ul>
            		 <li><input type="checkbox" id='ckwaiguanjiancha' class='menuchk menu_sel'  /><a href="#">外观检查</a></li>
            		 <li><input type="checkbox" id='ckbihoujiance' class='menuchk menu_sel'  /><a href="#">壁厚检测</a></li>
            		 <li><input type="checkbox" id='ckfangfucehoudujiance' class='menuchk menu_sel'  /><a href="#">防腐层厚度检测</a></li>
            		 <li><input type="checkbox" id='ckfangfucengposunjiance' class='menuchk menu_sel'  /><a href="#">防腐层破损检测</a></li>
            		 <li><input type="checkbox" id='ckfushizhuangkuangjiance' class='menuchk menu_sel'  /><a href="#">腐蚀状况检测</a></li>
            		 <li><input type="checkbox" id='ckshexianjiance' class='menuchk menu_sel'  /><a href="#">射线检测</a></li>
            	</ul>
            </li>
            <li><input type="checkbox" id='ckzhuanxiangjiance' class='menuchk menu_sel'  /><a href="#">专项检测</a>
            	<ul>
            		 <li><input type="checkbox" id='ckdaobojiance' class='menuchk menu_sel'  /><a href="#">导波检测</a></li>
            		 <li><input type="checkbox" id='ckcijiyijiance' class='menuchk menu_sel'  /><a href="#">磁记忆检测</a></li>
            		 <li><input type="checkbox" id='ckshunbiandiancijiance' class='menuchk menu_sel'  /><a href="#">瞬变电磁检测</a></li>
            	</ul>
            </li>
            <li><input type="checkbox" id='cklihuajiance' class='menuchk menu_sel'  /><a href="#">理化检测</a>
            	<ul>
            		 <li><input type="checkbox" id='ckyinglishiyan' class='menuchk menu_sel'  /><a href="#">应力试验</a></li>
            		 <li><input type="checkbox" id='ckhuaxuechengfenfenxi' class='menuchk menu_sel'  /><a href="#">化学成分分析</a></li>
            		 <li><input type="checkbox" id='ckyingduceshi' class='menuchk menu_sel'  /><a href="#">硬度测试</a></li>
            		 <li><input type="checkbox" id='ckjinxiangfenxi' class='menuchk menu_sel'  /><a href="#">金相分析</a></li>
            		 <li><input type="checkbox" id='cklashenshiyan' class='menuchk menu_sel'  /><a href="#">拉伸试验</a></li>
            		 <li><input type="checkbox" id='ckwanqushiyan' class='menuchk menu_sel'  /><a href="#">弯曲试验</a></li>
           			 <li><input type="checkbox" id='ckchongjishiyan' class='menuchk menu_sel'  /><a href="#">冲击试验</a></li>
            	</ul>
            </li>
            <li><input type="checkbox" id='ckxieloujiance' class='menuchk menu_sel'  /><a href="#">泄漏检测</a>
            	<ul>
            		 <li><input type="checkbox" id='ckjiancedian' class='menuchk menu_sel'  /><a href="#">检测点</a></li>
            		 <li><input type="checkbox" id='ckxieloujiancexieloudian' class='menuchk menu_sel'  /><a href="#">泄漏点</a></li>
            	</ul>
            </li>
            <li><input type="checkbox" id='ckfushifanghujiance' class='menuchk menu_sel'  /><a href="#">腐蚀防护系统</a>
            	<ul>
            		 <li><input type="checkbox" id='ckturangfushixingjiance' class='menuchk menu_sel'  /><a href="#">土壤腐蚀性检测</a></li>
            		 <li><input type="checkbox" id='ckzasandianliujiance' class='menuchk menu_sel'  /><a href="#">杂散电流检测</a></li>
            		 <!--  
            		 <li><input type="checkbox" id='ckfangfucengjueyuandianzu' class='menuchk menu_sel'  /><a href="#">防腐层绝缘电阻</a></li>
            		  -->
            		 <li><input type="checkbox" id='ckfangfucengjiancedian' class='menuchk menu_sel'  /><a href="#">防腐层检测点</a></li>
            		 <li><input type="checkbox" id='ckfangfucengposundian' class='menuchk menu_sel'  /><a href="#">防腐层破损点</a></li>
            		 <li><input type="checkbox" id='ckceshizhuangjiance' class='menuchk menu_sel'  /><a href="#">测试桩检测</a></li>
           			  <!--
           			 <li><input type="checkbox" id='ckyinjibaohuxiaoguojiance' class='menuchk menu_sel'  /><a href="#">阴极保护效果检测</a></li>
            		  -->
            		 <li><input type="checkbox" id='ckyinjibaohumijiangejiancedian' class='menuchk menu_sel'  /><a href="#">阴极保护密间隔检测点</a></li>      
            	</ul>
           <!--</li> -->
         </li>
          </ul>
        </li>
        
        <li class='bar1'><a href="#">应急辅助</a>
          <ul>
            <div class="nav_nav"></div>
			<li><a href="#" >事件定位</a>
				<ul>
					<li><a href="#" onclick='showshijiandw()'>坐标定位</a></li>
					<li><a href="#">编号定位</a></li>
				</ul>
			</li>
            <li><a href="#">信息</a></li>	
			<li><a href="#">位置发送</a></li>
			<li><a href="#">应急物资</a></li>
          </ul>
        </li>
        
		<li class='bar1'><a href="#">其他功能</a>
          <ul>
            <div class="nav_nav"></div>
            <!--  <li><a href="#" onclick='showdidianss()'>位置信息</a></li> -->
            <li><input type="checkbox" id='ckweizhixinxi' class='menuchk menu_sel'  /><a href="#" >位置信息</a></li>
            <li><input type="checkbox" id='ckjiaotongll' class='menuchk menu_sel'  /><a href="#" >交通流量</a></li>
            <li><input type="checkbox" id='ckweixing' class='menuchk menu_sel'  /><a href="#" >卫星图</a></li>
            <li><a href="#" onclick="showceju()">测距</a></li>
            <!-- <li><input type="checkbox" id='ckditubj' class='menuchk menu_sel'  /><a href="#" >地图背景</a></li> -->            
            <li><a href="#" >地图背景</a>
            	<ul>
            		<div class="nav_nav"></div>
            		<li><a href="#" onclick="setDitubjNormal()" >默认地图样式</a></li>
					<li><a href="#" onclick="setDitubjGrayscale()">高端灰风格</a></li>
					<li><a href="#" onclick="setDitubjDark()">黑夜风格</a></li>
					<li><a href="#" onclick="setDitubjLight()">清新蓝风格</a></li>
				</ul>
			</li>
            <!--  <li><a href="#" onclick="importGuanduan()">导入管段信息</a></li> -->
          </ul>
        </li>
        <li class='bar1'><a href="#">分析统计</a>
          <ul>
            <div class="nav_nav"></div>
            <li><a href="#" onclick="jingtaisj('')">基本信息汇总</a></li>
            <li><a href="#">检测数据汇总</a></li>
            <li><a href="#" onclick="jingtaisj('yalijz')">压力级制统计</a></li>
            <li><a href="#" onclick="jingtaisj('yunxingdw')">运行单位统计</a></li>
            <li><a href="#" onclick="jingtaisj('tezhengd')">特征点统计</a></li>
            <li><a href="#" onclick="jingtaisj('lishisj')">历史事件统计</a></li>
            <li><a href="#" onclick="jingtaisj('dongtaisj')">动态数据分析</a></li>
            <li><a href="#">按字段统计</a></li>
            <li><a href="#" onclick="jingtaisj('createdanxiant')">生成单线图</a></li>
          </ul>
        </li>
        <li class='bar1'><a href="#">评估评价</a>
          <ul>
            <div class="nav_nav"></div>
            <li><a href="#" onclick="fengxianpinggu()">可行性评估</a></li>
            <li><a href="#">设计评估</a></li>
            <li><a href="#" onclick='fengxianpgclick()' >风险评估</a></li>            
            <li><a href="#">腐蚀防护系统评价</a></li>
            <li><a href="#">合于使用评价</a></li>
            <li><a href="#" onclick='anquanzkdjclick()'>安全状况等级</a></li>
            <li><a href="#" onclick='coatingrisoclick()'>防腐层绝缘电阻</a></li>
            <li><a href="#" onclick='cpevaluateclick()'>阴极保护效果检测</a></li>        		  	
          </ul>
        </li>
       

        <li class='bar1'><a href="#">实时管理</a></li>
        <li class='bar1'><a href="#" onclick='changeRight("<%=request.getContextPath() %>/frame/auto!gotoList.action?formid=4848&isreport=1&temp=3871&_=1461829902546")'>报告报表</a></li>
      </ul>
    </div>
    
    <div class="content clearfix" style='overflow:hidden;'>
      <div class="contLeft">
        <div class="contLeft_main" >
          	<ul id="treeDemo" class="ztree" ></ul>
        </div>
      </div>
	  <!--
	   <form id='tableForm' method='post' >
	  		<input type='hidden' id='pipesectionnos' name='pipesectionnos' >
	   </form>
	  -->
      <div class="contRgt" valign="top" >
      	<!-- <iframe scrolling="no" src="portletAction!newPortlet.action" width="100%" height="700px" frameborder="0" id="mainframe" > </iframe> -->
      	<div id='searchpanel' style='margin-bottom:4px;display:none;'><input type='text' id='searchtext' >&nbsp;&nbsp;<a href="#" onclick='searchDidian()'>搜索</a></div>
      	<!--  <iframe id="mapcontent" scrolling="yes" src="<%=request.getContextPath() %>/map/mainmap.jsp" width="100%" height="480px" frameborder="0"  > </iframe>
  		-->
  		<iframe scrolling="no" id="mapcontent" scrolling="yes" src="<%=request.getContextPath() %>/map/mainmap.jsp" width="100%" frameborder="0"  > </iframe> 
      	<iframe  scrolling="no" src="<%=request.getContextPath() %>/map/mainTableList.jsp" width="1035"  frameborder="0" id="tableframe" height="285"> </iframe>
      </div>
    </div>
    <div class="foot"></div>
    <!-- 显示节点的类型，如是否显示特征点的树节点等 -->
    <input type='hidden' id='nodetypes' name='nodetypes'>
    <input type='hidden' id='gxchecked' name='gxchecked'>
    <!-- 所有被选中的节点 -->
    <input type='hidden' id='checknodes' name='checknodes'>
    <!-- 当前绘制的管线ID -->
    <input type='hidden' id='drawguanxianid' name='drawguanxianid'>
    <!--  -->
    <script type='text/javascript'>
    document.getElementById("mapcontent").height=document.body.offsetHeight-166;
    </script>
</body>
</html>


